示例#1
0
class ProjectManager(TenantModel):
    project = TenantForeignKey(Project, on_delete=models.CASCADE,
                               related_name='projectmanagers')
    manager = TenantForeignKey(Manager, on_delete=models.CASCADE)
    account = models.ForeignKey(Account, on_delete=models.CASCADE)

    tenant_id = 'account_id'
示例#2
0
class SubTask(TenantModel):
    name = models.CharField(max_length=255)
    type = models.CharField(max_length=255)
    account = models.ForeignKey(Account, on_delete=models.CASCADE)
    task = TenantForeignKey(Task, on_delete=models.CASCADE)
    project = TenantForeignKey(Project, on_delete=models.CASCADE, null=True)

    tenant_id = 'account_id'
示例#3
0
class Task(TenantModel):
    name = models.CharField(max_length=255)
    project = TenantForeignKey(Project,
                               on_delete=models.CASCADE,
                               related_name='tasks')
    account = models.ForeignKey(Account, on_delete=models.CASCADE)

    tenant_id = 'account_id'
示例#4
0
class Revenue(TenantModel):
    # To test for correct tenant_id push down in query
    acc = models.ForeignKey(Account,
                            on_delete=models.CASCADE,
                            related_name="revenues")
    project = TenantForeignKey(Project,
                               on_delete=models.CASCADE,
                               related_name="revenues")
    value = models.CharField(max_length=30)

    tenant_id = "acc_id"
示例#5
0
class Task(TenantModelMixin, models.Model):
    name = models.CharField(max_length=255)
    project = TenantForeignKey(Project,
                               on_delete=models.CASCADE,
                               related_name="tasks")
    account = models.ForeignKey(Account, on_delete=models.CASCADE)
    opened = models.BooleanField(default=True)

    parent = TenantForeignKey("self",
                              on_delete=models.CASCADE,
                              db_index=False,
                              blank=True,
                              null=True)

    objects = TaskManager()

    tenant_id = "account_id"

    def __str__(self):
        return "{} ({})".format(self.name, self.project)
示例#6
0
class Task(TenantModelMixin, models.Model):
    name = models.CharField(max_length=255)
    project = TenantForeignKey(Project,
                               on_delete=models.CASCADE,
                               related_name='tasks')
    account = models.ForeignKey(Account, on_delete=models.CASCADE)
    opened = models.BooleanField(default=True)

    objects = TaskManager()

    tenant_id = 'account_id'

    def __str__(self):
        return "{} ({})".format(self.name, self.project)
示例#7
0
class Record(TenantModel):
    id = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False)
    name = models.CharField(max_length=255)
    organization = TenantForeignKey(Organization, on_delete=models.CASCADE)

    tenant_id = 'organization_id'
示例#8
0
class AliasedTask(TenantModel):
    project_alias = TenantForeignKey(Project, on_delete=models.CASCADE)
    account = models.ForeignKey(Account, on_delete=models.CASCADE)

    tenant_id = 'account_id'