EGON Export fixes

* replaces missing value 'None' with empty string ''
This commit is contained in:
mpeltriaux 2022-12-13 06:49:03 +01:00
parent dd33085e3c
commit 0d58ed0501

View File

@ -190,14 +190,14 @@ class EgonGmlBuilder:
"@gml:id": self.intervention.identifier, "@gml:id": self.intervention.identifier,
"oneo:azEintragungsstelle": self.intervention.responsible.conservation_file_number, "oneo:azEintragungsstelle": self.intervention.responsible.conservation_file_number,
"oneo:azZulassungsstelle": self.intervention.responsible.registration_file_number, "oneo:azZulassungsstelle": self.intervention.responsible.registration_file_number,
"oneo:bemerkungZulassungsstelle": None, "oneo:bemerkungZulassungsstelle": "",
"oneo:eintragungsstelle": { "oneo:eintragungsstelle": {
"@xlink:href": f"http://register.naturschutz.rlp.de/repository/services/referenzliste/907/{cons_office.atom_id if cons_office else None}", "@xlink:href": f"http://register.naturschutz.rlp.de/repository/services/referenzliste/907/{cons_office.atom_id if cons_office else ''}",
"#text": cons_office.long_name if cons_office else None "#text": cons_office.long_name if cons_office else ""
}, },
"oneo:zulassungsstelle": { "oneo:zulassungsstelle": {
"@xlink:href": f"http://register.naturschutz.rlp.de/repository/services/referenzliste/1053/{reg_office.atom_id if reg_office else None}", "@xlink:href": f"http://register.naturschutz.rlp.de/repository/services/referenzliste/1053/{reg_office.atom_id if reg_office else ''}",
"#text": reg_office.long_name if reg_office else None "#text": reg_office.long_name if reg_office else ""
}, },
"oneo:ersatzzahlung": self._float_to_localized_string(self._sum_all_payments()), "oneo:ersatzzahlung": self._float_to_localized_string(self._sum_all_payments()),
"oneo:kompensationsart": { "oneo:kompensationsart": {
@ -205,33 +205,33 @@ class EgonGmlBuilder:
"#text": comp_type "#text": comp_type
}, },
"oneo:verfahrensrecht": { "oneo:verfahrensrecht": {
"@xlink:href": f"http://register.naturschutz.rlp.de/repository/services/referenzliste/1048/{law.atom_id if law else None}", "@xlink:href": f"http://register.naturschutz.rlp.de/repository/services/referenzliste/1048/{law.atom_id if law else ''}",
"#text": law.short_name if law else None "#text": law.short_name if law else ""
}, },
"oneo:verfahrenstyp": { "oneo:verfahrenstyp": {
"@xlink:href": f"http://register.naturschutz.rlp.de/repository/services/referenzliste/44382/{process_type.atom_id if process_type else None}", "@xlink:href": f"http://register.naturschutz.rlp.de/repository/services/referenzliste/44382/{process_type.atom_id if process_type else ''}",
"#text": process_type.long_name if process_type else None, "#text": process_type.long_name if process_type else "",
}, },
"oneo:eingreifer": { "oneo:eingreifer": {
"oneo:Eingreifer": { "oneo:Eingreifer": {
"oneo:art": { "oneo:art": {
"@xlink:href": f"http://register.naturschutz.rlp.de/repository/services/referenzliste/1053/{handler.type.atom_id if handler.type else None}", "@xlink:href": f"http://register.naturschutz.rlp.de/repository/services/referenzliste/1053/{handler.type.atom_id if handler.type else ''}",
"#text": handler.type.long_name if handler.type else None, "#text": handler.type.long_name if handler.type else "",
}, },
"oneo:bemerkung": handler.detail if handler else None, "oneo:bemerkung": handler.detail if handler else "",
} }
}, },
"oneo:erfasser": { "oneo:erfasser": {
"oneo:Erfasser": { "oneo:Erfasser": {
"oneo:name": None, "oneo:name": "",
"oneo:bemerkung": None, "oneo:bemerkung": "",
} }
}, },
"oneo:zulassung": { "oneo:zulassung": {
"oneo:Zulassungstermin": { "oneo:Zulassungstermin": {
"oneo:bauBeginn": payment_date, "oneo:bauBeginn": payment_date,
"oneo:erlass": reg_date.strftime(DEFAULT_DATE_FORMAT) if reg_date else None, "oneo:erlass": reg_date.strftime(DEFAULT_DATE_FORMAT) if reg_date else "",
"oneo:rechtsKraft": bind_date.strftime(DEFAULT_DATE_FORMAT) if bind_date else None, "oneo:rechtsKraft": bind_date.strftime(DEFAULT_DATE_FORMAT) if bind_date else "",
} }
}, },
"oneo:geometrie": { "oneo:geometrie": {
@ -245,8 +245,8 @@ class EgonGmlBuilder:
"oneo:kennung": self.intervention.identifier, "oneo:kennung": self.intervention.identifier,
"oneo:bezeichnung": self.intervention.title, "oneo:bezeichnung": self.intervention.title,
"oneo:bemerkung": self.intervention.comment, "oneo:bemerkung": self.intervention.comment,
"oneo:verantwortlicheStelle": None, "oneo:verantwortlicheStelle": "",
"oneo:veroffentlichtAm": None, "oneo:veroffentlichtAm": "",
"oneo:raumreferenz": { "oneo:raumreferenz": {
"oneo:Raumreferenz": self._gen_raumreferenz(), "oneo:Raumreferenz": self._gen_raumreferenz(),
}, },