organization limit for quota - get org childs
This commit is contained in:
@@ -135,6 +135,26 @@ class Organization(BaseModel):
|
||||
super(Organization, self).save(*args, **kwargs)
|
||||
|
||||
|
||||
class OrganizationStats(BaseModel):
|
||||
organization = models.OneToOneField(
|
||||
Organization,
|
||||
on_delete=models.CASCADE,
|
||||
related_name='stats',
|
||||
null=True
|
||||
)
|
||||
total_quota_received = models.PositiveBigIntegerField(default=0)
|
||||
total_distributed = models.PositiveBigIntegerField(default=0)
|
||||
total_inventory_in = models.PositiveBigIntegerField(default=0)
|
||||
total_sold = models.PositiveBigIntegerField(default=0)
|
||||
total_buyers = models.PositiveBigIntegerField(default=0)
|
||||
|
||||
def __str__(self):
|
||||
return f'Organization: {self.organization.name}'
|
||||
|
||||
def save(self, *args, **kwargs):
|
||||
return super(OrganizationStats, self).save(*args, **kwargs)
|
||||
|
||||
|
||||
class BankAccountInformation(BaseModel):
|
||||
user = models.ForeignKey(
|
||||
User,
|
||||
|
||||
Reference in New Issue
Block a user