add 2 new fields city & province in device - fix bug of filter_by_region
This commit is contained in:
@@ -1,12 +1,14 @@
|
||||
from apps.product.models import Product, Broker, QuotaBrokerValue, QuotaDistribution
|
||||
from django.contrib.postgres.fields import ArrayField
|
||||
from apps.authorization.models import UserRelations
|
||||
from apps.authentication.models import Organization
|
||||
from apps.core.models import BaseModel
|
||||
from django.db import models
|
||||
import random
|
||||
import string
|
||||
|
||||
from django.contrib.postgres.fields import ArrayField
|
||||
from django.db import models
|
||||
|
||||
from apps.authentication.models import Organization, City, Province
|
||||
from apps.authorization.models import UserRelations
|
||||
from apps.core.models import BaseModel
|
||||
from apps.product.models import Product, Broker, QuotaBrokerValue, QuotaDistribution
|
||||
|
||||
|
||||
class ProviderCompany(BaseModel):
|
||||
user_relation = models.ForeignKey(
|
||||
@@ -40,6 +42,18 @@ class Device(BaseModel):
|
||||
server_in = models.BooleanField(default=False)
|
||||
latitude = models.FloatField(default=0)
|
||||
longitude = models.FloatField(default=0)
|
||||
city = models.ForeignKey(
|
||||
City,
|
||||
on_delete=models.CASCADE,
|
||||
related_name='devices',
|
||||
null=True
|
||||
)
|
||||
province = models.ForeignKey(
|
||||
Province,
|
||||
on_delete=models.CASCADE,
|
||||
related_name='devices',
|
||||
null=True
|
||||
)
|
||||
is_activated = models.BooleanField(default=False)
|
||||
pre_registered = models.BooleanField(default=False)
|
||||
organization = models.ForeignKey(
|
||||
|
||||
Reference in New Issue
Block a user