Thursday, October 23, 2014

Importing models in app config module

Hallöchen!

https://docs.djangoproject.com/en/dev/ref/applications/ says:

You cannot import models in modules that define application
configuration classes, but you can use get_model() to access a
model class by name, like this:

Does this also apply to models of other apps? In particular, I need
import django.contrib.auth.models in my ready() method. Importing
it seems to work. So is this the way to go?

Tschö,
Torsten.

--
Torsten Bronger Jabber ID: torsten.bronger@jabber.rwth-aachen.de
or http://bronger-jmp.appspot.com

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/8761faj058.fsf%40physik.rwth-aachen.de.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment