2015-02-18 14:07 GMT+01:00 Loïc Bistuer <[email protected]>: > Individual routers don't have a base class but we can add it to the master > router `django.db.router`. I've updated the PR with a > `router.allow_migrate_model` method. I don't know if we should document > this just yet. >
Good. Unless I missed something that's an implementation detail. There's no need to document it. > Internally we now treat anything other than `app_label` as a hint, but I > guess we should still document `model_name=None` as part of the official > signature. > Yes. > Speaking about `model_name`, it seems to be the lowercase version of > `_meta.object_name` (which is basically __name__). I didn't investigate > further, can you confirm that `_meta.model_name` is what we want? > The alternative is model._meta.object_name. object_name is __name__ and model_name is object_name.lower(). Since model_name should be treated as case-insensitive — that's how Django works, most likely for no good reason — passing the lowercase version is less error-prone. If the developer doesn't account for case insensitivity, their code will fail immediately, since model class names are usually written in CamelCase. -- Aymeric. -- You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/django-developers. To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/CANE-7mUM-SEzfBR0S_CtCvhVNbd45%3DfC2F2aoDcim%3D2hX_GkoA%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
