diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2020-12-03 14:54:20 +0100 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2021-02-28 12:15:22 +0100 |
commit | a971793ef9759c6b99c674ba676607abd743e76b (patch) | |
tree | cd95c65028eeac282b12d435e4a5c44045123575 /archaeological_operations/models.py | |
parent | 42e32d4cdd18474c4daf5bf960cebb0855dad9ef (diff) | |
download | Ishtar-a971793ef9759c6b99c674ba676607abd743e76b.tar.bz2 Ishtar-a971793ef9759c6b99c674ba676607abd743e76b.zip |
TextField: blank=True, null=True -> blank=True, default=""
Diffstat (limited to 'archaeological_operations/models.py')
-rw-r--r-- | archaeological_operations/models.py | 63 |
1 files changed, 30 insertions, 33 deletions
diff --git a/archaeological_operations/models.py b/archaeological_operations/models.py index db573a650..cc1231f52 100644 --- a/archaeological_operations/models.py +++ b/archaeological_operations/models.py @@ -310,7 +310,7 @@ class ArchaeologicalSite(DocumentItem, BaseHistorizedItem, CompleteIdentifierIte reference = models.CharField(_("Reference"), max_length=200, unique=True) other_reference = models.TextField(_("Other reference"), blank=True, - null=True) + default="") name = models.CharField(_("Name"), max_length=200, null=True, blank=True) periods = models.ManyToManyField(Period, verbose_name=_("Periods"), @@ -322,28 +322,26 @@ class ArchaeologicalSite(DocumentItem, BaseHistorizedItem, CompleteIdentifierIte blank=True) towns = models.ManyToManyField(Town, verbose_name=_("Towns"), related_name='sites', blank=True) - comment = models.TextField(_("Comment"), null=True, blank=True) + comment = models.TextField(_("Comment"), blank=True, default="") locality_ngi = models.TextField( - _("National Geographic Institute locality"), - null=True, blank=True - ) - locality_cadastral = models.TextField(_("Cadastral locality"), - null=True, blank=True) + _("National Geographic Institute locality"), blank=True, default="") + locality_cadastral = models.TextField(_("Cadastral locality"), blank=True, + default="") collaborators = models.ManyToManyField( Person, blank=True, verbose_name=_("Collaborators"), related_name='site_collaborator' ) # underwater shipwreck_name = models.TextField( - _("Shipwreck name"), null=True, blank=True) + _("Shipwreck name"), blank=True, default="") oceanographic_service_localisation = models.TextField( - _("Oceanographic service localisation"), null=True, blank=True) + _("Oceanographic service localisation"), blank=True, default="") shipwreck_code = models.TextField( - _("Shipwreck code"), null=True, blank=True) + _("Shipwreck code"), blank=True, default="") sinking_date = models.DateField( _("Sinking date"), null=True, blank=True) discovery_area = models.TextField( - _("Discovery area"), null=True, blank=True) + _("Discovery area"), blank=True, default="") affmar_number = models.CharField(_("AffMar number"), max_length=100, null=True, blank=True) drassm_number = models.CharField(_("DRASSM number"), max_length=100, @@ -357,19 +355,19 @@ class ArchaeologicalSite(DocumentItem, BaseHistorizedItem, CompleteIdentifierIte on_delete=models.SET_NULL, verbose_name=_("Main image"), blank=True, null=True) cached_label = models.TextField( - _("Cached name"), null=True, blank=True, db_index=True, + _("Cached name"), blank=True, default="", db_index=True, help_text=_("Generated automatically - do not edit") ) cached_towns_label = models.TextField( - _("Cached town label"), blank=True, null=True, + _("Cached town label"), blank=True, default="", help_text=_("Generated automatically - do not edit") ) cached_periods = models.TextField( - _("Cached periods label"), blank=True, null=True, + _("Cached periods label"), blank=True, default="", help_text=_("Generated automatically - do not edit") ) cached_remains = models.TextField( - _("Cached remains label"), blank=True, null=True, + _("Cached remains label"), blank=True, default="", help_text=_("Generated automatically - do not edit") ) @@ -1099,8 +1097,8 @@ class Operation(ClosedItem, DocumentItem, BaseHistorizedItem, old_code = models.CharField(_("Old code"), max_length=200, null=True, blank=True) ## fr - code_patriarche = models.TextField("Code PATRIARCHE", null=True, - blank=True, unique=True) + code_patriarche = models.TextField( + "Code PATRIARCHE", blank=True, default="", unique=True) # preventive fnap_financing = models.FloatField("Financement FNAP (%)", blank=True, null=True) @@ -1127,11 +1125,11 @@ class Operation(ClosedItem, DocumentItem, BaseHistorizedItem, ## end fr operator_reference = models.CharField( _("Operator reference"), max_length=20, null=True, blank=True) - common_name = models.TextField(_("Generic name"), null=True, blank=True) - address = models.TextField(_("Address / Locality"), null=True, blank=True) - comment = models.TextField(_("Comment"), null=True, blank=True) + common_name = models.TextField(_("Generic name"), blank=True, default="") + address = models.TextField(_("Address / Locality"), blank=True, default="") + comment = models.TextField(_("Comment"), blank=True, default="") scientific_documentation_comment = models.TextField( - _("Comment about scientific documentation"), null=True, blank=True) + _("Comment about scientific documentation"), blank=True, default="") documents = models.ManyToManyField( Document, related_name='operations', verbose_name=_("Documents"), blank=True) @@ -1159,7 +1157,7 @@ class Operation(ClosedItem, DocumentItem, BaseHistorizedItem, RecordQualityType, verbose_name=_("Record quality"), on_delete=models.SET_NULL, null=True, blank=True,) - abstract = models.TextField(_("Abstract"), null=True, blank=True) + abstract = models.TextField(_("Abstract"), blank=True, default="") documentation_deadline = models.DateField( _("Deadline for submission of the documentation"), blank=True, null=True) @@ -1174,9 +1172,9 @@ class Operation(ClosedItem, DocumentItem, BaseHistorizedItem, drassm_code = models.CharField(_("DRASSM code"), max_length=100, null=True, blank=True) # judiciary - seizure_name = models.TextField(_("Seizure name"), blank=True, null=True) + seizure_name = models.TextField(_("Seizure name"), blank=True, default="") official_report_number = models.TextField(_("Official report number"), - blank=True, null=True) + blank=True, default="") protagonist = models.ForeignKey( Person, verbose_name=_("Name of the protagonist"), blank=True, null=True, related_name="operation_protagonist") @@ -1187,15 +1185,15 @@ class Operation(ClosedItem, DocumentItem, BaseHistorizedItem, Person, verbose_name=_("Writer of the minutes"), blank=True, null=True, related_name="minutes_writer") cached_towns_label = models.TextField( - _("Cached town label"), blank=True, null=True, + _("Cached town label"), blank=True, default="", help_text=_("Generated automatically - do not edit") ) cached_periods = models.TextField( - _("Cached periods label"), blank=True, null=True, + _("Cached periods label"), blank=True, default="", help_text=_("Generated automatically - do not edit") ) cached_remains = models.TextField( - _("Cached remains label"), blank=True, null=True, + _("Cached remains label"), blank=True, default="", help_text=_("Generated automatically - do not edit") ) @@ -2182,16 +2180,15 @@ class AdministrativeAct(BaseHistorizedItem, OwnPerms, ValueGetter): signature_date = models.DateField(_("Signature date"), blank=True, null=True) year = models.IntegerField(_("Year"), blank=True, null=True) - act_object = models.TextField(_("Object"), max_length=300, blank=True, - null=True) + act_object = models.TextField(_("Object"), blank=True, default="") if settings.COUNTRY == 'fr': ref_sra = models.CharField("Référence SRA", max_length=15, blank=True, null=True) departments_label = models.TextField( - _("Departments"), blank=True, null=True, + _("Departments"), blank=True, default="", help_text=_("Cached values get from associated departments")) towns_label = models.TextField( - _("Towns"), blank=True, null=True, + _("Towns"), blank=True, default="", help_text=_("Cached values get from associated towns")) history = HistoricalRecords() _prefix = 'adminact_' @@ -2425,8 +2422,8 @@ class Parcel(LightHistorizedItem): null=True, blank=True) auto_external_id = models.BooleanField( _("External ID is set automatically"), default=False) - address = models.TextField(_("Address - Locality"), null=True, blank=True) - cached_label = models.TextField(_("Cached name"), null=True, blank=True, + address = models.TextField(_("Address - Locality"), blank=True, default="") + cached_label = models.TextField(_("Cached name"), blank=True, default="", db_index=True) class Meta: |