Monday, October 29, 2012

Re: 1.5: syntax of AUTH_USER_MODEL

> Thanks, yup! I just figured it out too. I didn't realize all the "apps" are
> in the path as well.

the apps aren't NECESSARILY in the path. Django has a concept of app
label, which is the name of the directory where the models module
exists.

For example, django-cms has plugins, which in order to use, you need
to add to INSTALLED_APPS:

'cms.plugins.text',
'cms.plugins.picture'

but the app label of these plugins are just 'text' and 'picture'
respectively, and the "app model" path to their models are just
'text.TextPlugin', and 'picture.PicturePlugin'.

This is, IMO, the biggest and most stupid problem in django core
design, because it stops you from having an otherwise completely legal
configurations, like having a 'cms.plugins.picture' app alongside a
'myproject.custom.picture' one which might do something completely
different. I.E.: you can't have apps with repeated app labels even if
there's no python path conflict between them.

I don't know what the reason behind this is. I know it allows you to
make a model part of any given app regardless of where it's located
(via Meta.app_label), but this could very easily be extended (in a
backwards-incompatible way, I'm afraid) to require to be the fully
qualified name of the app package

--
"The whole of Japan is pure invention. There is no such country, there
are no such people" --Oscar Wilde

|_|0|_|
|_|_|0|
|0|0|0|

(\__/)
(='.'=)This is Bunny. Copy and paste bunny
(")_(") to help him gain world domination.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

No comments:

Post a Comment