Wednesday, June 23, 2010

Re: django-tagging registering

On Wed, Jun 23, 2010 at 11:52 AM, Jonathan Hayward <christos.jonathan.hayward@gmail.com> wrote:
what is an appropriate way to guarantee that Entity is only registered once?

Yes, it happens because models.py may be imported more than once.  You should put admin registrations in an admin.py file, not models.py, and call admin.autodiscover() from urls.py. See: http://docs.djangoproject.com/en/dev/ref/contrib/admin/#modeladmin-objects and http://docs.djangoproject.com/en/dev/ref/contrib/admin/#hooking-adminsite-instances-into-your-urlconf.

Karen
--
http://tracey.org/kmt/

--
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