First version
This commit is contained in:
15
polyclinic_scheduling/apps/polyclinic/models.py
Normal file
15
polyclinic_scheduling/apps/polyclinic/models.py
Normal file
@@ -0,0 +1,15 @@
|
||||
from django.db import models
|
||||
from django.utils.translation import gettext_lazy as _
|
||||
|
||||
from lib.models.base import MetaDataModel
|
||||
from apps.hospital.models import Hospital
|
||||
# Create your models here.
|
||||
|
||||
class Polyclinic(MetaDataModel):
|
||||
hospital = models.ForeignKey(Hospital, on_delete=models.CASCADE, help_text=_('To which hospital belongs this polyclinic'))
|
||||
name = models.CharField(_('Name'), max_length=200, blank=True, help_text=_('The name of this polyclinic'))
|
||||
phone = models.CharField(_('Phone number'), max_length=18, blank=True, help_text=_('The general/direct phone number of this polyclinic'))
|
||||
|
||||
def __str__(self):
|
||||
"""str: Returns a readable name for the hospital. Format is [hospital_name] ([city])."""
|
||||
return '{} ({})'.format(self.name, self.hospital)
|
||||
Reference in New Issue
Block a user