On Wed, Feb 3, 2010 at 11:02 PM, Klemens Mantzos <klemens.mant...@gmail.com> wrote: > thx! > > syncdb is now calling the database router before actually syncing to > the db. but... > > ...stumbled upon a new problem: > > if i do > python manage.py syncdb --database=default > before i sync the users database this error comes up (which seems ok to me): > django.db.utils.DatabaseError: (1146, "Table > 'multidb_user.auth_permission' doesn't exist") > > but if i do this: > python manage.py syncdb --database=users > i get that every time (no matter if django_content_type already exists > in the default db or not): > django.db.utils.DatabaseError: (1146, "Table > 'multidb_user.django_content_type' doesn't exist") > (Traceback http://pastie.org/807571.txt) > > seems that i'm the only one with this problem...but could find this ticket: > http://code.djangoproject.com/ticket/11828 (fixed aka. not > reproduceable aka. wontfix) > > pretty sad. i need a extra user db, so i thought its pretty much the > same as in the example in the docu > (http://docs.djangoproject.com/en/dev/topics/db/multi-db/). except the > masterslave stuff. but it seems like i'm constantly overseeing stuff.
No - you're an early adopter of a feature that has only just been added. Bugs are to be expected; we need bug reports like yours to ensure we iron out all the bugs before 1.2 final. > here is my code (again): > # don't know but OtherRouter is maybe obsolete. > DATABASE_ROUTERS = ['dbrouter.AuthRouter', 'dbrouter.OtherRouter'] > > ### project/dbrouter.py > > class AuthRouter(object): > """A router to control all database operations on models in > the contrib.auth application""" > > .... > > def allow_syncdb(self, db, model): > "Make sure the auth app only appears on the 'credentials' db" > if db == 'users': > return model._meta.app_label == 'auth' > elif model._meta.app_label == 'auth': > return False > return None > > > class OtherRouter(object): > """A router that sets up a simple master/slave configuration""" > > ... > > def allow_syncdb(self, db, model): > "Explicitly put all models on all databases." > return True > > any suggestions? It looks to me like #11828 has re-emerged with the introduction of routers. Strictly, it will be a new problem, because the issue lies with the interaction between routers and syncdb, especially with the post-syncdb handler for the contenttypes app. I've opened #12767 to track this issue. Thanks for the report, Russ Magee %-) -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.