Hi guys,

It seems to me that an (abstract) base class for the database routers would 
be useful to inherit for people. Makes implementing a router slightly 
easier.

I was thinking something along these lines:
import abc


class ConnectionRouterBase(abc.ABC):

    @abstractmethod
    def db_for_read(self, model, **hints):
        ...

    @abstractmethod
    def db_for_write(self, model, **hints):
        ...

    @abstractmethod
    def allow_relation(self, obj1, obj2, **hints):
        ...

    @abstractmethod
    def allow_migrate(self, db, app_label, **hints):
        ...

Would a pull request like that be acceptable?

~rick

-- 
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 django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/c0e572d8-9075-4061-9c3b-e5074db2159e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to