Friday, December 22, 2017

Re: Let the model define the database with a custom router

I have the same problem as Stodge.

What I know right know is that the method parameters of allow_migrate changed from def allow_migrate(self, db, model) to def allow_migrate(self, db, app_label, model_name=None, **hints). Since that change, you don't have any reference to a model class any more. Just strings parameters but no objects.

I've tried to gather a model class instance from that parameters in many ways, no luck so far. What you get sometimes is a class object in hints['models'], but too late to useful for our case.

If someone more skilled can help us out, very very welcome!
Cheers!

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/126de696-8d99-490b-9f8e-0dcb4e0ae9a3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment