]> git.ipfire.org Git - thirdparty/python-drafthorse.git/commitdiff
Fix languages field definition, adjust test and update readme (#87)
authorTobias Kuhn <tobias.kuhn.73@googlemail.com>
Thu, 27 Nov 2025 19:01:12 +0000 (20:01 +0100)
committerGitHub <noreply@github.com>
Thu, 27 Nov 2025 19:01:12 +0000 (20:01 +0100)
* fix languages field definition, adjust test and update readme

* Rename

---------

Co-authored-by: Raphael Michel <michel@rami.io>
README.rst
drafthorse/models/document.py
tests/conftest.py

index b2ba766bd071a71f6300cc76c5c8f0d8b6248a34..7a326ab075990c7ec556b809e67eb7d46962a719 100644 (file)
@@ -66,7 +66,7 @@ Generating::
     doc.header.type_code = "380"
     doc.header.name = "RECHNUNG"
     doc.header.issue_date_time = date.today()
-    doc.header.languages.add("de")
+    doc.header.language = "ger"
 
     note = IncludedNote()
     note.content.add("Test Node 1")
index 4b16f3126233f68b332808d9964b9c0874362a1d..be53a76549f6817ee2592816ba51bf2d292d2e30 100644 (file)
@@ -80,7 +80,7 @@ class Header(Element):
         profile=EXTENDED,
         _d="Indikator Original/Kopie",
     )
-    languages: StringContainer = MultiStringField(
+    language = StringField(
         NS_RAM, "LanguageID", required=False, profile=EXTENDED
     )
     notes: Container = MultiField(IncludedNote)
index 5238a6f7fd245d6abad5d61ca040c565679e05b3..30690fa65fb394b3a985c97ea2697c2dd91fcbb5 100644 (file)
@@ -20,7 +20,7 @@ def invoice_document(request):
     doc.header.type_code = request.param
     doc.header.name = "RECHNUNG"
     doc.header.issue_date_time = date.today()
-    doc.header.languages.add("de")
+    doc.header.language = "ger"
 
     doc.header.notes.add(IncludedNote(content="Test Node 1"))