syncdb should cleanup tables?!?!

2 views
Skip to first unread message

jedie

unread,
May 10, 2007, 4:54:15 AM5/10/07
to Django developers
I have Problems with old entries in "django_content_type". I described
it here: http://groups.google.com/group/django-users/browse_thread/thread/4f74fc5a98f7c8fe/1b542eff91614ab8
I get the error "ContentType matching query does not exist." if i
create a new user group.

The Problem is: I had content types in my db without the corresponding
model class.
This happens, when you remove applications from your project or if you
delete some model class in your app.
There is a more detailed description in the german python-forum:
http://www.python-forum.de/topic-10510.html

I've hacked a standalone script to delete old entries in the tables
"django_content_type" and "django_content_type": http://paste.pocoo.org/show/1482/
This it not enough. Other tables must be still updated:
"auth_user_user_permissions", "auth_group_permissions", etc.

Should that not do syncdb? Perhaps with an additional parameter, e.g.:
"django-admin.py syncdb --cleanup=true"

Reply all
Reply to author
Forward
0 new messages