#1658: db.models.base.ModelBase.__new__ fails to deduce app_label with model
packages
-------------------------------------------+--------------------------------
Reporter: [EMAIL PROTECTED] | Owner: adrian Type: defect | Status: reopened Priority: high | Milestone: Component: Core framework | Version: SVN Severity: major | Resolution: Keywords: egg, distutils, pkg_resources | -------------------------------------------+--------------------------------
Changes (by [EMAIL PROTECTED]):

 * keywords:  egg, distutils => egg, distutils, pkg_resources

Comment:

update on patch above and should works for getting the ``app_label``
object.
{{{
from pkg_resources import resource_string, Requirement
model_module = 'foo/bar/models.py'
project_name = 'quux'
requirement = Requirement.parse(project_name)
app_label = resource_string(requirement, module_name)
# do stuff with app_label here
}}}

--
Ticket URL: <http://code.djangoproject.org/ticket/1658#comment:>
Django <http://code.djangoproject.org/>
The web framework for perfectionists with deadlines.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Django 
updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to