예제 #1
0
class Category(TenantAbstract):
    name = models.CharField(max_length=10)

    objects = TenantManager()

    def __str__(self):
        return self.name
예제 #2
0
class Category(TenantModel):
    name = models.CharField(max_length=50)

    objects = TenantManager.from_queryset(CategoryQuerySet)()

    def __str__(self):
        return self.name
예제 #3
0
class Product(TenantAbstract, BaseModel):
    name = models.CharField(max_length=50)
    category = models.ForeignKey('app_test.Category', on_delete=models.CASCADE)

    objects = TenantManager()

    def __str__(self):
        return self.name
예제 #4
0
class Product(TenantAbstract):
    name = models.CharField(max_length=10)
    category = models.ForeignKey('tests.Category',
                                 null=True,
                                 on_delete=models.SET_NULL)

    objects = TenantManager()

    def __str__(self):
        return self.name
예제 #5
0
class Contact(TenantAbstract):
    name = models.CharField(max_length=10)

    objects = TenantManager.from_queryset(ContactQuery)()
예제 #6
0
class TenantModel(TenantAbstract, BaseModel):
    objects = TenantManager()

    class Meta:
        abstract = True