stake holders model, paginate organizations by order
This commit is contained in:
@@ -230,3 +230,25 @@ class DeviceAssignment(BaseModel):
|
||||
|
||||
def save(self, *args, **kwargs):
|
||||
return super(DeviceAssignment, self).save(*args, **kwargs)
|
||||
|
||||
|
||||
class StakeHolders(BaseModel):
|
||||
assignment = models.ForeignKey(
|
||||
DeviceAssignment,
|
||||
on_delete=models.CASCADE,
|
||||
related_name='stake_holders',
|
||||
null=True
|
||||
)
|
||||
organization = models.ForeignKey(
|
||||
Organization,
|
||||
on_delete=models.CASCADE,
|
||||
related_name='stake_holders',
|
||||
null=True
|
||||
)
|
||||
share_percent = models.FloatField(default=0)
|
||||
|
||||
def __str__(self):
|
||||
return f'Device: {self.assignment.device.serial}-organization: {self.organization.name}'
|
||||
|
||||
def save(self, *args, **kwargs):
|
||||
return super(StakeHolders, self).save(*args, **kwargs)
|
||||
Reference in New Issue
Block a user