2008-6-15

01:50 StevenPotter
Well, I just posted this in #django, but I will give it another try here (maybe a different audience)
01:50 StevenPotter
I'm doing some work on ticket #7199 and it seems to be a problem in the where clause of the SQL statement that is being issued.
01:50 DjangoBot
01:50 StevenPotter
However, I am having trouble finding where in the code that SQL is generated.
01:50 StevenPotter
Any pointers on where to look?
01:52 cramm
StevenPotter: look on django/db/models/sql/where.py and query.py
01:54 cramm
StevenPotter: can you reproduce the probmen with more than one db backend?
01:55 StevenPotter
I don't know. I only know that the problem is present on MySQL
01:55 cramm
can you try on sqlite3?
01:56 StevenPotter
I was just thinking I would give that a try.
01:56 StevenPotter
I haven't used sqlite much. Is it possible to log the queries issued?
01:57 cramm
yes, using the same trick
01:58 cramm
02:07 StevenPotter
Yes, it seems that the same problem exists with sqlite
17:18 mitsuhiko
maybe one of you could join this discussion here: http://thread.gmane.org/gmane.comp.python.devel...
17:18 mitsuhiko
(about an ordered dict implementation in the stdlib)
17:19 mitsuhiko
i know django uses ordered dicts, maybe you could bring your expertise in
17:30 SimonW
any newforms-admin people around who can give a quick code review to my solution for the relative path problem?
17:32 SimonW
17:34 SimonW
rats, that's the wrong patch
17:34 SimonW
http://dpaste.com/hold/56735/ is correct (uses root_path instead of admin_root)
17:34 SimonW
I went through a bunch of iterations but in the end the cleanest solution seems to be to stash the calculated root path on the AdminSite instance itself, which can then be accessed from ModelAdmin instances through self.admin_site.root_path
18:03 SimonW
mitsuhiko: not much I can add to that discussion, really like the way you've written / documented your odict.py module though
18:04 SimonW
brosner: any chance you could glance over http://dpaste.com/hold/56735/ ? I think I've solved the relative path issue
18:05 brosner
SimonW: looks good to me. did you have tests for it?
18:06 brosner
did userlinks move up to a base template?
18:06 SimonW
didn't move, it was always present in base.html
18:06 brosner
ah ok
18:06 SimonW
it's just now there's no need to over-ride it in the various other templates
18:07 SimonW
which also means that if you want to customise those links you can do so using your own base_site.html template
18:07 SimonW
(at GCap we need to ditch the "change password" link as we manage passwords using LDAP, and we need the documentation link to point to our wiki since we don't want our end users seeing Django template / models docs)
18:07 brosner
there are also places in ModelAdmin with relative paths
18:08 SimonW
in the actual code itself? stuff like redirects?
18:08 SimonW
hmm... should fix those too
18:08 brosner
yeah redirects
18:08 SimonW
I haven't touched the breadcrumb code yet either
18:08 mitsuhiko
SimonW: i'm writing a pep now. birkenfeld thinks that's the best way to get that implemented :)
18:09 SimonW
as long as there's nothing wrong with the basic approach (I'm pretty sure there isn't) I'll crack on with fixing those other bits and check it in
18:10 brosner
yeah sounds good to me
18:10 brosner
the basic approach looks solid
18:12 SimonW
oh blast, just did a search in django/contrib/admin for "../" and there's a metric ton of stuff I missed
18:12 SimonW
lots of it is in util.py and widgets.py, which probably won't have access to the AdminSite object
18:15 SimonW
reckon it's worth checking in in two chunks? The fix I have at the moment doesn't break anything and adds some useful functionality (the ability to over-ride userlinks in base_site.html)
18:15 brosner
yeah, i forgot about the widgets
18:15 SimonW
the further refactoring of redirects will actually involve some larger code changes so might be easier to follow in separate commits
18:15 brosner
agreed
18:41 SimonW
rats, forgot the "newforms-admin: " tag on [7638]
18:41 brosner
i hate when i do that too
18:45 SimonW
OK, I'm baffled by this
18:45 SimonW
line 13 of django/contrib/admin/urls.py : http://code.djangoproject.com/browser/django/br...
18:45 brosner
urls.py isn't used
18:45 SimonW
('^auth/user/add/$', 'django.contrib.admin.views.auth.user_add_stage') - but I can't find a "user_add_stage" function mentioned anywhere else in the code base?
18:45 SimonW
aha!
18:46 brosner
the entry point for the site is AdminSite.root
18:46 SimonW
any reason we can't just delete urls.py out right?
18:46 brosner
yeah it should be deleted. i was going to go through and kill dead code this week
18:47 SimonW
so where's the custom view used for http://localhost:8000/admin/auth/user/add/ ? that's the view that only asks for a username and password to create a new user
18:47 SimonW
I can't see where its URL is dealt with
18:48 brosner
18:50 SimonW
cool, thanks - need to fix that one as well
20:18 telenieko
brosner & SimonW as you are playing around with nfa, would you mind in commiting #5405? I know it's not critical, but due it's small impact it could be taken away from the list ;)
20:18 DjangoBot
20:18 telenieko
(yes, two days triaging and I just went to Ready for checkin)
20:19 telenieko
Oh, only if the patch is still ok (it's 1 year old) if not let me know and I'll move it back to accepted
20:20 telenieko
same for #5775 if applicable
20:20 DjangoBot
20:20 telenieko
DjangoBot, you seem to know a lot about tickets... tell me, when will we reach Point 0? hehe.. :P