bugungi kun
This commit is contained in:
@@ -1,4 +1,7 @@
|
||||
from .base import *
|
||||
from .region import *
|
||||
from .district import *
|
||||
from .place import *
|
||||
from .place import *
|
||||
from .doctor import *
|
||||
from .pharmacy import *
|
||||
from .plan import *
|
||||
29
core/apps/shared/models/doctor.py
Normal file
29
core/apps/shared/models/doctor.py
Normal file
@@ -0,0 +1,29 @@
|
||||
from django.db import models
|
||||
|
||||
# shared
|
||||
from core.apps.shared.models import BaseModel, District, Place
|
||||
# accounts
|
||||
from core.apps.accounts.models import User
|
||||
|
||||
|
||||
class Doctor(BaseModel):
|
||||
# information
|
||||
first_name = models.CharField(max_length=200)
|
||||
last_name = models.CharField(max_length=200)
|
||||
phone_number = models.CharField(max_length=15)
|
||||
work_place = models.CharField(max_length=200)
|
||||
sphere = models.CharField(max_length=200)
|
||||
description = models.TextField()
|
||||
# relations
|
||||
district = models.ForeignKey(District, on_delete=models.CASCADE, related_name='doctors')
|
||||
place = models.ForeignKey(Place, on_delete=models.CASCADE, related_name='doctors')
|
||||
user = models.ForeignKey(User, on_delete=models.CASCADE, related_name='doctors')
|
||||
# location
|
||||
longitude = models.FloatField(default=0.00)
|
||||
latitude = models.FloatField(default=0.00)
|
||||
extra_location = models.JSONField()
|
||||
|
||||
def __str__(self):
|
||||
return f"{self.first_name} {self.last_name} - {self.work_place}"
|
||||
|
||||
|
||||
26
core/apps/shared/models/pharmacy.py
Normal file
26
core/apps/shared/models/pharmacy.py
Normal file
@@ -0,0 +1,26 @@
|
||||
from django.db import models
|
||||
|
||||
# shared
|
||||
from core.apps.shared.models import BaseModel, District, Place
|
||||
# accounts
|
||||
from core.apps.accounts.models import User
|
||||
|
||||
|
||||
class Pharmacy(BaseModel):
|
||||
# informations
|
||||
name = models.CharField(max_length=200)
|
||||
inn = models.CharField(max_length=200)
|
||||
owner_phone = models.CharField(max_length=15)
|
||||
responsible_phone = models.CharField(max_length=15)
|
||||
# relations
|
||||
district = models.ForeignKey(District, on_delete=models.CASCADE, related_name='pharmacies')
|
||||
place = models.ForeignKey(Place, on_delete=models.CASCADE, related_name='pharmacies')
|
||||
user = models.ForeignKey(User, on_delete=models.CASCADE, related_name='pharmacies')
|
||||
# location
|
||||
longitude = models.FloatField(default=0.00)
|
||||
latitude = models.FloatField(default=0.00)
|
||||
extra_location = models.JSONField()
|
||||
|
||||
def __str__(self):
|
||||
return f"{self.name} - {self.inn}"
|
||||
|
||||
17
core/apps/shared/models/plan.py
Normal file
17
core/apps/shared/models/plan.py
Normal file
@@ -0,0 +1,17 @@
|
||||
from django.db import models
|
||||
|
||||
# shared
|
||||
from core.apps.shared.models import BaseModel
|
||||
# accounts
|
||||
from core.apps.accounts.models import User
|
||||
|
||||
|
||||
class Plan(BaseModel):
|
||||
title = models.CharField(max_length=200)
|
||||
description = models.TextField()
|
||||
date = models.DateField()
|
||||
# relations
|
||||
user = models.ForeignKey(User, on_delete=models.CASCADE, related_name='plans')
|
||||
|
||||
def __str__(self):
|
||||
return self.title
|
||||
Reference in New Issue
Block a user