mirror of https://github.com/interlegis/sapl.git
Marcio Mazza
10 years ago
committed by
Marcio Mazza
9 changed files with 1571 additions and 2 deletions
@ -0,0 +1,3 @@ |
|||||
|
from django.contrib import admin |
||||
|
|
||||
|
# Register your models here. |
File diff suppressed because it is too large
@ -0,0 +1,3 @@ |
|||||
|
from django.test import TestCase |
||||
|
|
||||
|
# Create your tests here. |
@ -0,0 +1,3 @@ |
|||||
|
from django.shortcuts import render |
||||
|
|
||||
|
# Create your views here. |
@ -0,0 +1,5 @@ |
|||||
|
Django |
||||
|
MySQL-python |
||||
|
psycopg2 |
||||
|
|
||||
|
ipdb |
@ -0,0 +1,21 @@ |
|||||
|
class LegacyRouter(object): |
||||
|
|
||||
|
def db_for_read(self, model, **hints): |
||||
|
if model._meta.app_label == 'legacy': |
||||
|
return 'legacy' |
||||
|
return None |
||||
|
|
||||
|
def db_for_write(self, model, **hints): |
||||
|
if model._meta.app_label == 'legacy': |
||||
|
return 'legacy' |
||||
|
return None |
||||
|
|
||||
|
def allow_relation(self, obj1, obj2, **hints): |
||||
|
if obj1._meta.app_label == 'legacy' and obj2._meta.app_label == 'legacy': |
||||
|
return True |
||||
|
return None |
||||
|
|
||||
|
def allow_migrate(self, db, model): |
||||
|
if model._meta.app_label == 'legacy': |
||||
|
return False |
||||
|
return None |
Loading…
Reference in new issue