Commit | Line | Data |
---|---|---|
39e40a5f PH |
1 | |
2 | # encoding: utf-8 | |
3 | ||
4 | ||
5 | class RORouter(object): | |
6 | def db_for_read(self, model, **hints): | |
7 | return None | |
8 | ||
9 | def db_for_write(self, model, **hints): | |
10 | if model._meta.app_label in ['auth', 'sessions', 'dashboard']: | |
11 | return None | |
12 | else: | |
13 | assert False, "Vous ne pouvez écrire dans l'application: {}".format(model._meta.app_label) | |
14 | ||
15 | def allow_relation(self, obj1, obj2, **hints): | |
16 | return True | |
17 | ||
18 | def allow_migrate(self, db, model): | |
19 | return True |