2010-3-9

02:36 mattmcc
I don't suppose anyone recalls which ticket tracked the undoing of tag library module name mangling..
02:43 kmt
mattmcc: you mean #6587?
02:43 DjangoBot
02:43 mattmcc
Sweet, thanks.
12:04 mitsuhiko
Alex_Gaynor: ping
15:39 ubernostrum
I'm seriously going to go blank and lock the damn "threadlocal user" wiki page.
15:39 ubernostrum
Any objections? ;)
16:11 jezdez
ubernostrum: +1
16:21 apollo13
ubernostrum: oh noes ;) what's happening?
17:16 robhudson
if anyone agrees with the last comment on #8960, I'd happily supply a patch. the current patches seems a bit ugly to me... This is 'view on site' breakage if contrib.sites is not installed. Current patches start introspecting the current model to see if there's a related field to sites. I like the RequestSite fallback idea much better.
17:16 DjangoBot
17:17 mtrichardson
+1
18:12 Alex_Gaynor
mitsuhiko: pong
18:12 mitsuhiko
Alex_Gaynor: heyho :)
23:23 freakboy3742
ubernostrum: ping
23:29 carljm
freakboy3742: if you have a moment sometime, i'd welcome thoughts on the approach in #12953
23:29 DjangoBot
23:30 freakboy3742
carljm: looking
23:32 pantsman
is #5986 believed to be a dupe of #8164? Since 5986 related to (non-model) Forms, and was closed as a dupe of 8164 which was fixed for only ModelForm
23:32 DjangoBot
23:32 DjangoBot
23:34 freakboy3742
carljm: On the surface, it looks ok
23:34 freakboy3742
I'm at work at the moment, so I can't do a complete teardown
23:34 freakboy3742
but I'll put it on my list
23:35 freakboy3742
On the whole, the approach looks good - yet another score for proper models for m2m
23:35 Alex_Gaynor
:)
23:35 freakboy3742
THere's one edge case that I don't know if you're testing for
23:35 Alex_Gaynor
carljm: given any thought to my idea to improve efficiency of deletions of the object graph?
23:36 freakboy3742
a manually created m2m intermediate that has a FK or m2m of it's own
23:36 freakboy3742
I haven't worked through the logic, but my but tells me there might be an edge case in there that is, at the very least, worth checking for.
23:36 carljm
freakboy3742: I think that case should fall out automatically, given that I call _collect_sub_objects on the through model instances
23:37 Alex_Gaynor
carljm: test it!
23:37 carljm
but I'll check and make sure it's tested somewhere
23:37 freakboy3742
There's an off chance it may already be tested
23:38 carljm
i think this improves the code maintainability; i guess my one question is how much effort i need to put into tracking down and quantifying possible speed implications
23:39 carljm
or is this a case of "do the right thing and if it turns out we can speed it up later, we will"
23:39 Alex_Gaynor
carljm: well we know we can speed it up later
23:39 Alex_Gaynor
I already presented my architecture for doing so
23:39 carljm
yeah, i think we can too. but not before 1.2
23:39 Alex_Gaynor
agreed
23:40 carljm
the other problem with your (otherwise excellent) proposal for speeding it up is that it pretty much trashes the fix we already put in for #6191
23:40 DjangoBot
23:40 carljm
at least i can't figure out how to make them compatible
23:40 carljm
because the admin needs a per-object hierarchy
23:41 carljm
(or at least Adrian said that objects-to-be-deleted display has to stay hierarchical)
23:41 freakboy3742
carljm: Make it work, then make it work fast :-)
23:41 Alex_Gaynor
carljm: well we can maintain the per object traversal for the obj.delete() case
23:41 Alex_Gaynor
Given an abstract graph of the obj relations translating it into per-object traversal or bulk traversals shouldn't be overly difficult
23:42 carljm
freakboy3742: great. as long as speed won't keep this fix from getting in for 1.2, we'll work on a post-1.2 fix for speeding up _collect_sub_objects
23:43 carljm
Alex_Gaynor: the admin also does QuerySet.delete(), if you delete using the bulk action
23:43 carljm
but I think you're right, the translation from model-graph to object-graph should be possible, just perhaps not fast
23:43 Alex_Gaynor
carljm: well we can do invidiual _collect_sub_objects to display the graph, and then use the optimized calll for the deletion itself?
23:43 carljm
but nobody cares too much if the admin delete-confirm page is slow
23:44 Alex_Gaynor
carljm: we can also cache the Delete graph ones its generated
23:44 carljm
the thing I want to avoid is getting back to a situation where its one code path for the confirmation display, and a different one for the deletion
23:45 carljm
but if we do it in terms of generating model-graph + pk-lists (the fast way) in either case, then an optional step of translating that into an object-graph, i think that would be reasonable
23:45 Alex_Gaynor
carljm: it won't be, there's be a DeleteGraph class that provides the data, and then Deleters that take a graph, and either a qs or an indiivdual obj and traverse the graph and do deletions, one Deleter will be efficiently implemented for QS with multiple items, and one will be for single objects
23:45 carljm
even if the second optional step is slow
23:45 Alex_Gaynor
The DeleteGraph is the part where the logic is tricky
23:45 Alex_Gaynor
finding objects given a DeleteGraph isn't difficult
23:49 carljm
yep, that all makes sense. as you say we can cache the DeleteGraph on the model class, though that's not the slow part (doesn't even hit the DB)
23:50 carljm
actually though, that doesn't really address the multiple-code-paths concern
23:50 Alex_Gaynor
carljm: It'd deifnitely help, especially since we can cache it for foverver
23:50 carljm
it's still entirely possible for one Deleter to have a bug the other one doesn't
23:50 Alex_Gaynor
carljm: I tihnk the hard to get write codepath is the DeleteGraph generation, not the traverseing
23:50 carljm
for them to come up with different sets of objects
23:50 Alex_Gaynor
carljm: thats true, but I don't see a way around it
23:51 Alex_Gaynor
carljm: Actually... we can just make obj.delete() -> Model.objects.fitler(pk=obj.pk).delete()
23:51 Alex_Gaynor
TADA single path
23:51 Alex_Gaynor
carljm: although i don't see how that helps us for showing the deletion tree
23:51 carljm
the multiple code paths i'm concerned about aren't single object vs queryset
23:52 carljm
personally i think the fast approach will be better for general use in either case
23:52 carljm
once you're at depth two it's multiple objects either way
23:52 Alex_Gaynor
carljm: I'm saying we can fix taht for the actual deletion, but that avoids generating the tree, which is whate the admin needs
23:52 carljm
yeah
23:53 Alex_Gaynor
carljm: so yeah, I don't see a way to avoid some amount of duplication
23:53 carljm
it's the admin tree i'm concerned about. i want that list of objects generated in a way that makes it trivially obvious that it will contain the same set of objects as the ones that are actually deleted
23:53 carljm
which I think is doable, but not quite using the DeleteGraph/Deleter architecture
23:54 carljm
if we can produce a DeleteGraph with lists of PKs for each model involved
23:54 Alex_Gaynor
carljm: Actually, I guess given a set of objects that the deleter has found (efficiently) it sholud be possible to regenerate a tree from them
23:54 carljm
using the fast route
23:54 carljm
exactly
23:54 carljm
then we generate an object tree based on that
23:54 Alex_Gaynor
GMTA
23:54 carljm
heh
23:54 Alex_Gaynor
sounds good
23:54 carljm
that whole process is then slower than what we do now
23:54 carljm
but who cares, its just for the confirmation page
23:55 Alex_Gaynor
right, bulk deletion will be hugely faster
23:55 carljm
and worth it for the reliability IMO
23:55 Alex_Gaynor
agreed
23:55 carljm
alright then! plan is in place. now who will get around to turning it into code first...
23:56 carljm
have you filed a ticket for it yet?
23:56 Alex_Gaynor
no
23:56 carljm
i'm on it
23:56 Alex_Gaynor
thanks