add some new info to pos distributions list - has sale license-free sale
This commit is contained in:
18
apps/core/migrations/0008_systemconfig_quota.py
Normal file
18
apps/core/migrations/0008_systemconfig_quota.py
Normal file
@@ -0,0 +1,18 @@
|
||||
# Generated by Django 5.0 on 2025-09-15 10:39
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('core', '0007_systemconfig'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='systemconfig',
|
||||
name='quota',
|
||||
field=models.CharField(max_length=50, null=True),
|
||||
),
|
||||
]
|
||||
@@ -56,10 +56,13 @@ class MobileTest(BaseModel):
|
||||
class SystemConfig(BaseModel):
|
||||
key = models.CharField(max_length=100, null=True)
|
||||
value = models.CharField(max_length=100, null=True)
|
||||
quota = models.CharField(max_length=50, null=True)
|
||||
|
||||
@classmethod
|
||||
def get(cls, key, default=None):
|
||||
def get(cls, key, quota_identity=None, default=None):
|
||||
try:
|
||||
if quota_identity:
|
||||
return cls.objects.get(key=key, quota=quota_identity).value
|
||||
return cls.objects.get(key=key).value
|
||||
except cls.DoesNotExist:
|
||||
return default
|
||||
|
||||
Reference in New Issue
Block a user