On 23-08-11 01:31, Jim wrote:
def allow_syncdb(self, db, model):
# db is a string of database name.
label = model._meta.app_label
if label == 'books':
dbName = 'test'
else:
dbName = None
return dbName == db
I'd do the "if" part as follows:
if label == 'books':
if db == 'test':
return True
return False
if db == 'test':
return False
return None # None means 'no opinion'.
iirc allow_syncdb() ought to return True/False to indicate whether a
certain model should be synced to a certain database. So you need to
make sure *two* things:
- Your special models only end up in your special database and not in
another.
- Other models (like the django_content_type table that gives you
problems!) should not end up in your special deatabase.
Reinout
--
Reinout van Rees http://reinout.vanrees.org/
[email protected] http://www.nelen-schuurmans.nl/
"If you're not sure what to do, make something. -- Paul Graham"
--
You received this message because you are subscribed to the Google Groups "Django
users" 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-users?hl=en.