diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2020-12-07 22:38:47 +0100 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2021-02-28 12:15:22 +0100 |
commit | c55dc561c68e7fb24e4396e815a95b0ec7a24106 (patch) | |
tree | 56200214cef47ad38209d35f4608b957c3b83a70 | |
parent | ee0179cbbe14e400aff6b0e9c865ce6e36152ea4 (diff) | |
download | Ishtar-c55dc561c68e7fb24e4396e815a95b0ec7a24106.tar.bz2 Ishtar-c55dc561c68e7fb24e4396e815a95b0ec7a24106.zip |
Update doc with grammatical gender and long title
-rw-r--r-- | docs/fr/source/annexe-tech-3-variables-gen.rst | 17 | ||||
-rw-r--r-- | ishtar_common/models.py | 36 |
2 files changed, 41 insertions, 12 deletions
diff --git a/docs/fr/source/annexe-tech-3-variables-gen.rst b/docs/fr/source/annexe-tech-3-variables-gen.rst index c669d5f3b..5909b2990 100644 --- a/docs/fr/source/annexe-tech-3-variables-gen.rst +++ b/docs/fr/source/annexe-tech-3-variables-gen.rst @@ -7,7 +7,7 @@ Annexe technique 3 - Variables ============================== :Auteurs: Étienne Loks, Ishtar team -:Date: 2020-12-02 +:Date: 2020-12-07 :Copyright: CC-BY 3.0 :Ishtar Version: v3.1.0 @@ -111,7 +111,7 @@ Chaque personne dispose des :ref:`champs adresse <valeurs-champs-adresse>`, ains - **operation_protagonist__** : *→ Opérations (nom du protagoniste)* - **operation_responsability__** : *→ Opérations (responsable)* - **operation_scientist_responsability__** : *→ Opérations (responsable du suivi scientifique)* -- **person_types__** : *→ Type de personne* (**label** Dénomination, **txt_idx** Identifiant textuel) - Types +- **person_types__** : *→ Type de personne* (**label** Dénomination, **txt_idx** Identifiant textuel, **grammatical_gender** Grammatical gender - "M": Male ; "F": Female ; "N": Neutral) - Types - **precise_town__** : *→ Commune* (**name** Nom, **numero_insee** Code commune (numéro INSEE), **cached_label** Nom en cache) - Commune (précis) - **raw_name** : *Chaîne de caractères (300)* - Nom brut - **responsible_town_planning_service_files__** : *→ Dossiers archéologiques (responsable pour le service instructeur)* @@ -120,7 +120,7 @@ Chaque personne dispose des :ref:`champs adresse <valeurs-champs-adresse>`, ains - **signatory__** : *→ Actes administratifs (signataire)* - **site_collaborator__** : *→ Entités archéologiques (collaborateurs)* - **surname** : *Chaîne de caractères (50)* - Prénom - Attention, historical and unfortunate residue in the code of an initial translation error. -- **title__** : *→ Type de titre* (**label** Dénomination, **txt_idx** Identifiant textuel) - Titre +- **title__** : *→ Type de titre* (**label** Dénomination, **txt_idx** Identifiant textuel, **long_title** Long title) - Titre - **treatmentfile_applicant__** : *→ Demandes de traitement (demandeur)* - **treatmentfile_responsability__** : *→ Demandes de traitement (personne responsable)* - **treatments__** : *→ Traitements (responsable)* @@ -148,7 +148,7 @@ Chaque organisation dispose des :ref:`champs adresse <valeurs-champs-adresse>`, - **name** : *Chaîne de caractères (500)* - Nom - **operation_applicant_authority__** : *→ Opérations (autorité requérante)* - **operator__** : *→ Opérations (opérateur)* -- **organization_type__** : *→ Type d'organisation* (**label** Dénomination, **txt_idx** Identifiant textuel) - Type +- **organization_type__** : *→ Type d'organisation* (**label** Dénomination, **txt_idx** Identifiant textuel, **grammatical_gender** Grammatical gender - "M": Male ; "F": Female ; "N": Neutral) - Type - **planning_service_files__** : *→ Dossiers archéologiques (service instructeur)* - **precise_town__** : *→ Commune* (**name** Nom, **numero_insee** Code commune (numéro INSEE), **cached_label** Nom en cache) - Commune (précis) - **publish__** : *→ Documents (publisher)* @@ -163,6 +163,7 @@ Documentation - **additional_information** : *Texte* - Information supplémentaire +- **administrativeacts__** : *→ Actes administratifs (documents)* - **associated_file** : *Image (255)* - Dossier associé - La taille maximale supportée pour le fichier est de 100 Mo. - **associated_links** : *Texte* - Liens symboliques - **associated_url** : *Adresse web (1000)* - Ressource numérique (adresse web) @@ -192,6 +193,7 @@ Documentation - **item_number** : *Entier* - Nombre d'éléments - **language__** : *→ Langue* (**label** Dénomination, **txt_idx** Identifiant textuel) - Langue - **licenses__** : *→ Type de licence* (**label** Dénomination, **txt_idx** Identifiant textuel) - Licence +- **main_image_administrativeacts__** : *→ Actes administratifs (image principale)* - **main_image_containers__** : *→ Contenants (image principale)* - **main_image_context_records__** : *→ Unité d'Enregistrement (image principale)* - **main_image_finds__** : *→ Mobilier (image principale)* @@ -224,12 +226,14 @@ Acte administratif ****************** -- **act_object** : *Texte (300)* - Objet +- **act_object** : *Texte* - Objet - **act_type__** : *→ Type d'acte* (**label** Dénomination, **txt_idx** Identifiant textuel) - Type d'acte - **associated_file__** : *→ Dossier archéologique* - Dossier archéologique - **departments_label** : *Texte* - Départements - Valeur en cache des départements associés +- **documents__** : *→ Document* - Documents - **in_charge__** : *→ Personne* - Responsable d'opération - **index** : *Entier* - Index +- **main_image__** : *→ Document* - Image principale - **operation__** : *→ Opération* - Opération - **operator__** : *→ Organisation* - Opérateur d'archéologie préventive - **property__** : *→ Propriétés (acte administratif)* @@ -427,6 +431,7 @@ Chaque dossier archéologique dispose du champ `data__` ainsi que des champs sui - **permit_reference** : *Texte* - Référence du permis - **permit_type__** : *→ Type de permis* (**label** Dénomination, **txt_idx** Identifiant textuel) - Type de permis - **planning_service__** : *→ Organisation* - Service instructeur +- **planning_service_date** : *Date* - Date of planning service file - **protected_area** : *Booléen* - Au sein d'un secteur sauvegardé - **qrcode** : *Image (255)* - qrcode - **raw_general_contractor** : *Chaîne de caractères (200)* - Aménageur (brut) @@ -537,7 +542,7 @@ Chaque élément mobilier dispose du champ `data__` ainsi que des champs suivant - **appraisal_date** : *Date* - Date d'évaluation - **base_finds__** : *→ Mobilier d'origine* - Mobilier d'origine - **basket__** : *→ Paniers (items)* -- **cached_label** : *Texte* - Nom en cache +- **cached_label** : *Texte* - Nom en cache - Généré automatiquement - ne pas éditer - **cached_materials** : *Texte* - Nom en cache des types de matériaux - Généré automatiquement - ne pas éditer - **cached_object_types** : *Texte* - Nom en cache des types d'objet - Généré automatiquement - ne pas éditer - **cached_periods** : *Texte* - Nom en cache des périodes - Généré automatiquement - ne pas éditer diff --git a/ishtar_common/models.py b/ishtar_common/models.py index cf0a41c54..55d9ed164 100644 --- a/ishtar_common/models.py +++ b/ishtar_common/models.py @@ -1638,12 +1638,31 @@ GENDER = ( ) -class OrganizationType(GeneralType): +class GenderedType(GeneralType): grammatical_gender = models.CharField( _("Grammatical gender"), max_length=1, choices=GENDER, blank=True, default="") class Meta: + abstract = True + + @classmethod + def get_documentation_string(cls): + """ + Used for automatic documentation generation + """ + doc = super(GenderedType, cls).get_documentation_string() + doc += ", **grammatical_gender** {} -".format(_("Grammatical gender")) + for idx, gender in enumerate(GENDER): + key, label = gender + if idx: + doc += " ;" + doc += ' "{}": {}'.format(key, label) + return doc + + +class OrganizationType(GenderedType): + class Meta: verbose_name = _("Organization type") verbose_name_plural = _("Organization types") ordering = ('label',) @@ -1780,11 +1799,7 @@ class Organization(Address, Merge, OwnPerms, ValueGetter, MainItem): post_save.connect(cached_label_changed, sender=Organization) -class PersonType(GeneralType): - grammatical_gender = models.CharField( - _("Grammatical gender"), max_length=1, choices=GENDER, - blank=True, default="") - +class PersonType(GenderedType): class Meta: verbose_name = _("Person type") verbose_name_plural = _("Person types") @@ -1855,6 +1870,15 @@ class TitleType(GeneralType): verbose_name_plural = _("Title types") ordering = ('label',) + @classmethod + def get_documentation_string(cls): + """ + Used for automatic documentation generation + """ + doc = super(TitleType, cls).get_documentation_string() + doc += ", **long_title** {}".format(_("Long title")) + return doc + post_save.connect(post_save_cache, sender=TitleType) post_delete.connect(post_save_cache, sender=TitleType) |