remove quota balance from quota mode
This commit is contained in:
@@ -38,8 +38,50 @@ class Device(BaseModel):
|
|||||||
|
|
||||||
|
|
||||||
class DeviceVersion(BaseModel):
|
class DeviceVersion(BaseModel):
|
||||||
pass
|
device = models.ForeignKey(
|
||||||
|
Device,
|
||||||
|
on_delete=models.CASCADE,
|
||||||
|
related_name='devices',
|
||||||
|
null=True
|
||||||
|
)
|
||||||
|
company = models.ForeignKey(
|
||||||
|
PaymentCompany,
|
||||||
|
on_delete=models.CASCADE,
|
||||||
|
related_name='devices',
|
||||||
|
null=True
|
||||||
|
)
|
||||||
|
name = models.CharField(max_length=250, null=True)
|
||||||
|
code = models.IntegerField(default=0)
|
||||||
|
description = models.TextField(null=True)
|
||||||
|
enable = models.BooleanField(default=True)
|
||||||
|
remove = models.BooleanField(default=False)
|
||||||
|
|
||||||
|
def __str__(self):
|
||||||
|
return f'Version: {self.name}-{self.device.serial}'
|
||||||
|
|
||||||
|
def save(self, *args, **kwargs):
|
||||||
|
return super(DeviceVersion, self).save(*args, **kwargs)
|
||||||
|
|
||||||
|
|
||||||
class Sessions(BaseModel):
|
class Sessions(BaseModel):
|
||||||
pass
|
device = models.ForeignKey(
|
||||||
|
Device,
|
||||||
|
on_delete=models.CASCADE,
|
||||||
|
related_name='devices',
|
||||||
|
null=True
|
||||||
|
)
|
||||||
|
name = models.CharField(max_length=125, null=True)
|
||||||
|
password = models.CharField(max_length=25, null=True)
|
||||||
|
version = models.IntegerField(default=0)
|
||||||
|
mac = models.CharField(max_length=50, null=True)
|
||||||
|
ip = models.CharField(max_length=15, default='0.0.0.0')
|
||||||
|
sdk = models.TextField(null=True)
|
||||||
|
serial = models.TextField(null=True)
|
||||||
|
latitude = models.DecimalField(max_digits=20, decimal_places=10, null=True)
|
||||||
|
longitude = models.DecimalField(max_digits=20, decimal_places=10, null=True)
|
||||||
|
|
||||||
|
def __str__(self):
|
||||||
|
return f'Session: {self.name}-{self.version}-{self.id}'
|
||||||
|
|
||||||
|
def save(self, *args, **kwargs):
|
||||||
|
return super(Sessions, self).save(*args, **kwargs)
|
||||||
|
|||||||
@@ -50,7 +50,6 @@ class QuotaSerializer(serializers.ModelSerializer):
|
|||||||
instance.quota_weight = validated_data.get('quota_weight', instance.quota_weight)
|
instance.quota_weight = validated_data.get('quota_weight', instance.quota_weight)
|
||||||
instance.remaining_weight = validated_data.get('remaining_weight', instance.remaining_weight)
|
instance.remaining_weight = validated_data.get('remaining_weight', instance.remaining_weight)
|
||||||
instance.quota_distributed = validated_data.get('quota_distributed', instance.quota_distributed)
|
instance.quota_distributed = validated_data.get('quota_distributed', instance.quota_distributed)
|
||||||
instance.quota_balance = validated_data.get('quota_balance', instance.quota_balance)
|
|
||||||
instance.product = validated_data.get('product', instance.product)
|
instance.product = validated_data.get('product', instance.product)
|
||||||
instance.sale_type = validated_data.get('sale_type', instance.sale_type)
|
instance.sale_type = validated_data.get('sale_type', instance.sale_type)
|
||||||
instance.sale_unit = validated_data.get('sale_unit', instance.sale_type)
|
instance.sale_unit = validated_data.get('sale_unit', instance.sale_type)
|
||||||
|
|||||||
Reference in New Issue
Block a user