Hi,

I've added a ticket with a patch for automatically discovering models within
a package without using the app_label Meta attribute. An old and somewhat
related ticket is: http://code.djangoproject.com/ticket/2289/.

This addition is relatively small code-wise, but it does add a new feature
to the framework. Instead of "looking one level up" from the module a model
is defined in the new code looks one level up from the module/package named
"models" and then falls back to the existing behavior of simply "looking one
level up" if no such module/package exists.

I've added examples of the new functionality to the existing comments in the
code:

For 'django.contrib.sites.models', one level up would be 'sites'.
For 'geo.models.places' it would be 'geo'.
For 'polymorphic.polymorhpic_model' it would be 'polymorphic'.

I've also copied and slightly modified the existing model_package model
tests to cover the new code.

This addition is very intuitive IMO, and it definitely cuts down on the
overhead incurred when making the design decision to group models into a
package. I certainly find it useful.

Per the Django contributor guidelines I'm asking for guidance about whether
this patch is considered non-trivial. Any feedback is appreciated.

Thanks,

- Mark

http://code.djangoproject.com/ticket/14007

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

Reply via email to