2008-6-12

17:29 jacobkm
jezdez: http://groups.google.com/group/djangocon-organi... -- it's members-only just to keep s/n high, but I've no problem with people joining it if they wanna help out.
17:31 jezdez
oh sure, I've been talking with people here organizing a one or two day workshop so I'm definitely interested
17:32 jacobkm
jezdez: yup, that's the idea behind the list :)
17:32 jezdez
great :)
17:40 jezdez
jacobkm: I owe you some diffs from the doc refactor sprint btw :) they are almost finished and need to be proofread -- will work on them over the weekend
17:40 jacobkm
sweet
18:06 trbs
#3591
18:06 DjangoBot
18:18 jezdez
18:20 trbs
yeah good one thnx :)
21:00 brosner
Newmaniese: got a second?
21:00 Newmaniese
Sure what's up
21:00 brosner
i am looking at #6776 again and am not liking the use of a metaclass
21:00 DjangoBot
21:01 Newmaniese
yea there be dragons
21:02 brosner
so i am thinking about just doing an automatic import of admin modules in INSTALLED_APPS
21:02 brosner
i never did like having people use __init__ to import admin
21:02 jacobkm
brosner: I'd really like [__import__("%s.admin" % app) for app in INSTALLED_APPS)]
21:02 brosner
yeah thats what i just wrote. one sec
21:03 jacobkm
I'm pretty sure I got a grudging +0 from Adrian, too, so I'd say just do it.
21:03 Newmaniese
brosner: only thing about that is it kinda ruins the whole multiple admin thing
21:03 brosner
21:04 jacobkm
Another option is a AdminSite.autodiscover() method. You could call it from urls.py, maybe.
21:04 jacobkm
(Dunno about that second part, but...)
21:05 jacobkm
I think I'd prefer an explicit autodiscover() call, but figuring out where it'd get called is a bit annoying.
21:05 jkocherhans
jacobkm: Adrian gave a +0 as long as it was optional iirc
21:05 Newmaniese
What about an admin.py in project root where you can define apps that should be in the admin and different admins
21:05 jacobkm
jkocherhans: yeah, I think so
21:06 jacobkm
Newmaniese: you can't count on there even being a "project" -- that's sorta a starter concept, anyway.
21:06 jacobkm
i.e. most advanced users don't use 'em
21:06 Newmaniese
I was thinking next to settings
21:07 brosner tries to understand how things would work without autodiscover? the same as it is now?
21:08 jacobkm
brosner: yeah
21:08 Newmaniese
autodiscover sounds good to me
21:08 brosner
so then some docs about the multiple import paths?
21:09 jacobkm
yeah
21:09 Newmaniese
brosner: have you been able to duplicate my mod_python bug?
21:10 brosner
i haven't. i also dont use mod_python. but nothing has cropped up in mod_wsgi
21:10 Newmaniese
Yea, the logout ticket is an example of it in auth. It's messy and con only happen in mod_python
21:11 Newmaniese
I have tried in runserver mod_wsgi with the same setup and it only occurs in mod_python under really certain circumstances
21:13 Newmaniese
it doesn't occur with controled import time, so an autodiscover will fix it. Anything that imports the admin from the models is where it causes problems
21:15 Newmaniese
FYI that ticket is #6718
21:15 DjangoBot
21:21 brosner
jacobkm: http://dpaste.com/56324 <-- then the call could be from django.contrib import admin ; admin.autodiscovery() in a urls.py.
21:22 jacobkm
yeah
21:22 jacobkm
I kinda don't like it in urls.py, but whatdayagonnado?
21:22 brosner
yeah i have that same dislike
21:23 jacobkm
Well, looks like we've got two options:
21:23 jacobkm
(a) have admin.autodisocover (clean) but call it from urls.py (dirty)
21:23 jacobkm
(b) autodiscover automatically (dirty)
21:24 jacobkm
We could easily turn off autodiscovery with a setting, but that only makes it slightly less gross.
21:24 jacobkm
Hrm
21:25 jkocherhans
somewhere, somehow, we're import for side effects (which I think is what's really causing the eeew) the only other choice I see is 'dotted.paths.in.strings' style config
21:25 jkocherhans
s/import/importing/
21:25 jacobkm
jkocherhans: exactly
21:26 jkocherhans
so what would Django do? (obviously not invent ZCML again :) )
21:26 brosner
ugh, need to head to bank be back in a few
21:26 jkocherhans
fwiw we have the same problem with signal registration
21:27 Gulopine loves discussions
21:27 jezdez
wouldn't that be a good thing to put in a generic App() class, side by side with app_label and verbose_name and other app centric options?
21:28 jacobkm
let's not make this a bigger deal than it is
21:32 jkocherhans
yeah, I didn't put that out there as an "oh shit, let's fix this" more of a "maybe someone has an idea that we haven't thought of yet that might go somewhere"
21:32 jkocherhans
putting it in urls.py is fine w/ me
21:33 jezdez
I say boo
21:33 jacobkm
I think I'd learn more towards automatic autodiscovery with a setting to turn it off.
21:38 jezdez
would that setting kill the autodiscovery for all apps? I mean would I be able to specify which apps to leave out?
21:38 lsoto
any reason why PhoneNumberField inherits from IntegerField?
21:39 lsoto
I see that PhoneNumberField overrides everything that is implemented by IntegerField...
21:40 lsoto
and, OTOH, phone numbers are stored as varchar on all backends
21:40 lsoto
have I missed something?
21:42 jkocherhans
I'd rather have autodiscovery at an app level as well, but maybe global for now and app specific overrides once the App class stuff lands?
21:45 jezdez
yes, that's the best option, you are right
21:51 brosner
i'd say lets go with option a for now. it solves the problems we have seen and we can expand on it once app class stuff lands.
21:56 brosner
actually a setting might make more sense now that i think about it
22:00 Honza
jezdez: jkocherhans once App class jumps into existence, there is no need for any autodiscovery, it could just be an "initialize" method on it
22:02 Honza
for now, why don't we just autodiscover something neutral (like module called discover_me.py ;) ) so that it's not admin-specific... we have bunch of stuff that needs this - signals, logging settings, some app-specific initializations etc.
22:02 Honza
btw. sorry to jump in the middle of a discussion, but remembering how we talked about the exact same thing in chicago I couldn't resist
22:03 jezdez
yeah I also remembered and jumped in the discussion :)
22:03 jkocherhans
s'ok. I missed out on that discussion.
22:04 Honza
jkocherhans: you can't do it in URLs - some apps don't have urls.py but want to use admin (or signals, or whatever)
22:05 jkocherhans
so basically a place to put all the imports for side-effects for your app?
22:05 Honza
jkocherhans: exactly
22:05 Honza
and once the App class is here, we would move it there (with the default being importing that very module that we can now choose to autodiscover)
22:05 Newmaniese
I have a quick question: if I have an app, call it profiles and have 2 sites that use it but I only want one to have it in it's admin how will that work?
22:06 jkocherhans
Newmaniese: 2 different settings files. nothing special.
22:07 Honza
well, but with the autodiscover as global option it would either be all apps or none
22:07 Newmaniese
jkocherhans: did i miss something, is the autodiscovery coming from the installed apps?
22:08 Newmaniese
That is worse then what exists now
22:08 Newmaniese
in NFA
22:08 Honza
Newmaniese: you would have to either not use autodiscover at all, and do it as you would now, or in the discovered module check for the site_id and not register it in some cases
22:09 Newmaniese
Honza: sounds a little messy, but doable
22:09 Newmaniese
right now I do all my imports in the root urls.py
22:09 Newmaniese
which isn't much better
22:10 Honza
Newmaniese: I am afraid that the clean solution here is known, but feared - its the App class ;), the rest is more or less hackish... or at least that's how I see it, if anyone can think of another clean solution, please share
22:11 jezdez
I fully stand behind the things we discussed at pycon, see http://code.djangoproject.com/wiki/InstalledApp...
22:12 jezdez
but I think jacobkm and brosner looked for a fast solution
22:12 Newmaniese
Is it doable in this timeline?
22:12 Newmaniese
what about a decorator on the app
22:13 Honza
jezdez: I see...
22:13 Newmaniese
so it can be developed now, wrapped around something else (autodiscovery) and when the app class hits you just move it to that
Page 2 of 3   ← Previous  Next →(212 total)