Add documentation

This commit is contained in:
2020-05-18 14:22:52 +02:00
parent 2fa124f529
commit e761864c3e
19 changed files with 621 additions and 9 deletions

View File

@ -5,6 +5,23 @@ from lib.models.base import MetaDataModel
# Create your models here.
class Hospital(MetaDataModel):
"""
A model that holds the hospital 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
----------
name : str
The name of the hospital. Max length is 200 characters.
address : str
The address of the hospital. Street and housenumber. Max length is 200 characters.
postal_code : str
The postcalcode of the hospital. Max length is 10 characters.
city : str
The city where this hospital is located. Max length is 60 characters.
phone : str
The general phone number of this hospital. Max length is 20 characters.
"""
class Meta:
verbose_name = _('hospital')
@ -14,7 +31,7 @@ class Hospital(MetaDataModel):
address = models.CharField(_('Address'), max_length=200, blank=True, help_text=_('The address of this hospital'))
postal_code = models.CharField(_('Postal code'), max_length=10, blank=True, help_text=_('The postal code of this hospital'))
city = models.CharField(_('City'), max_length=60, blank=True, help_text=_('The city of this hospital'))
phone = models.CharField(_('Phone number'), max_length=18, blank=True, help_text=_('The general phone number of this hospital'))
phone = models.CharField(_('Phone number'), max_length=20, blank=True, help_text=_('The general phone number of this hospital'))
def __str__(self):
"""str: Returns a readable name for the hospital. Format is [hospital_name] ([city])."""