south and django 1.3.1

169 views
Skip to first unread message

Jan Vilhuber

unread,
Dec 23, 2011, 6:54:54 PM12/23/11
to south...@googlegroups.com
I manage some django tables with south as well, and was just experimenting with 1.3.1 which I hope to switch to very soon.

As with most custom types, I needed to add:

from south.modelsinspector import add_introspection_rules
add_introspection_rules([], ["^django\.contrib\.auth\.models\.Foo"])

Now when I start my app, I get:
...
File "/Users/vilhuber/src/nukona/git/Django/django/contrib/auth/models.py", line 590, in <module>
from south.modelsinspector import add_introspection_rules
File "/Library/Python/2.6/site-packages/South-0.7.3-py2.6.egg/south/modelsinspector.py", line 17, in <module>
from django.contrib.contenttypes import generic
File "/Users/vilhuber/src/nukona/git/Django/django/contrib/contenttypes/generic.py", line 13, in <module>
from django.contrib.admin.options import InlineModelAdmin, flatten_fieldsets
File "/Users/vilhuber/src/nukona/git/Django/django/contrib/admin/__init__.py", line 6, in <module>
from django.contrib.admin.sites import AdminSite, site
File "/Users/vilhuber/src/nukona/git/Django/django/contrib/admin/sites.py", line 3, in <module>
from django.contrib.admin import ModelAdmin, actions
ImportError: cannot import name actions

If I remove the instrospection rule and import, it starts fine, but then of course manage.py schemamigration complains.

What's the right way to do this? Is there a way I can detect if this is being included as part of a schememigration, i.e. a conditional include?

jan

Andrew Godwin

unread,
Dec 24, 2011, 12:51:27 PM12/24/11
to south...@googlegroups.com
I'm not sure why that's failing - looks weirldy like a circular import issue.

Is it just the import that does this, or the call as well?

Jan Vilhuber <jan.vi...@gmail.com> wrote:
-- 
You received this message because you are subscribed to the Google Groups "South Users" group.
To post to this group, send email to south...@googlegroups.com.
To unsubscribe from this group, send email to south-users...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/south-users?hl=en.

Jeremy Dunck

unread,
Dec 24, 2011, 1:31:14 PM12/24/11
to south...@googlegroups.com, south...@googlegroups.com
It looks like you've modified Django auth to depend on south? Don't do that; nearly everything depends eventually on auth, and that will cause you lots of pain. 
Reply all
Reply to author
Forward
0 new messages