Exemplo n.º 1
0
class Category(TenantAbstract):
    name = models.CharField(max_length=10)

    objects = TenantManager()

    def __str__(self):
        return self.name
Exemplo n.º 2
0
class Category(TenantModel):
    name = models.CharField(max_length=50)

    objects = TenantManager.from_queryset(CategoryQuerySet)()

    def __str__(self):
        return self.name
Exemplo n.º 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
Exemplo n.º 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
Exemplo n.º 5
0
class Contact(TenantAbstract):
    name = models.CharField(max_length=10)

    objects = TenantManager.from_queryset(ContactQuery)()
Exemplo n.º 6
0
class TenantModel(TenantAbstract, BaseModel):
    objects = TenantManager()

    class Meta:
        abstract = True