2015-02-18 14:07 GMT+01:00 Loïc Bistuer :
> 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 somethi
Loïc, the model_name is indeed the lower-case version of the
object_name:
https://github.com/django/django/blob/master/django/db/models/options.py#L203
On Wednesday, February 18, 2015 at 2:07:28 PM UTC+1, Loïc Bistuer wrote:
>
> Individual routers don't have a base class but we can add it to the
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.
Internally we now treat anything other than `app_label` as a hint, but I guess
2015-02-18 6:34 GMT+01:00 Loïc Bistuer :
> Another option would be to make the signature `allow_migrate(self, db,
> app_label, model_name=None, **hints)` and to put the model class in the
> hints dict, the same way we pass `instance` as hint to the other routers.
Yes, that's what I wanted to sug
Another option would be to make the signature `allow_migrate(self, db,
app_label, model_name=None, **hints)` and to put the model class in the hints
dict, the same way we pass `instance` as hint to the other routers.
That would make the 80% use-case less fiddly without any loss of functionality.
> On Feb 18, 2015, at 05:18, Andrew Godwin wrote:
>
> I am fine with the proposed change to allow better routing of
> RunSQL/RunPython (though in the RunPython case people can easily do routing
> inside the python code provided anyway, as you can see the DB aliases there).
True although that
e proposed fix for the release blocker
> https://code.djangoproject.com/ticket/24351 suggests changing the
> signature of the `allow_migrate` database router.
> >
> > From:
> > def allow_migrate(self, db, model):
> >
> > To:
> > def allow_migrate(self, db, app_l
On 17 févr. 2015, at 11:06, Loïc Bistuer wrote:
> The proposed fix for the release blocker
> https://code.djangoproject.com/ticket/24351 suggests changing the signature
> of the `allow_migrate` database router.
>
> From:
> def allow_migrate(self, db, model):
>
> To:
l=None in RunPython/SQL.
>
> On Tuesday, February 17, 2015 at 5:06:24 AM UTC-5, Loïc Bistuer wrote:
> Hi all,
>
> The proposed fix for the release blocker
> https://code.djangoproject.com/ticket/24351 suggests changing the signature
> of the `allow_migrate` database rout
el=None in
RunPython/SQL.
On Tuesday, February 17, 2015 at 5:06:24 AM UTC-5, Loïc Bistuer wrote:
>
> Hi all,
>
> The proposed fix for the release blocker
> https://code.djangoproject.com/ticket/24351 suggests changing the
> signature of the `allow_migrate` database router.
>
&g
Hi all,
The proposed fix for the release blocker
https://code.djangoproject.com/ticket/24351 suggests changing the signature of
the `allow_migrate` database router.
From:
def allow_migrate(self, db, model):
To:
def allow_migrate(self, db, app_label, model, **hints):
We need to make a design
11 matches
Mail list logo