Add documentation
This commit is contained in:
@ -6,6 +6,19 @@ from apps.hospital.models import Hospital
|
||||
# Create your models here.
|
||||
|
||||
class Polyclinic(MetaDataModel):
|
||||
"""
|
||||
A model that holds the polyclinic information. This is just basic information just for getting in contact.
|
||||
It will inherit the attributes :attr:`~lib.models.base.MetaDataModel.created_at` and :attr:`~lib.models.base.MetaDataModel.updated_at` from the Abstract model :class:`~lib.models.base.MetaDataModel`
|
||||
|
||||
Attributes
|
||||
----------
|
||||
hospital : Hospital
|
||||
The hospital where this polyclinic belongs to.
|
||||
name : str
|
||||
The name of the polyclinic. Max length is 200 characters.
|
||||
phone : str
|
||||
The general/direct phone number of this polyclinic. Max length is 20 characters.
|
||||
"""
|
||||
|
||||
class Meta:
|
||||
verbose_name = _('polyclinic')
|
||||
@ -13,8 +26,8 @@ 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'))
|
||||
phone = models.CharField(_('Phone number'), max_length=20, 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])."""
|
||||
"""str: Returns a readable name for the polyclinic. Format is [polyclinic_name] ([hospital_name])."""
|
||||
return '{} ({})'.format(self.name, self.hospital)
|
||||
|
Reference in New Issue
Block a user