Skip to content
Snippets Groups Projects
Commit d0f4201c authored by Anders H. Rebner's avatar Anders H. Rebner
Browse files

#38 #39 endret json-key from og to til from_date og to_date

parent 6e759fbb
No related branches found
No related tags found
1 merge request!40#38 #39 Eksporter og importer SOI til/fra fil
Pipeline #77058 passed
......@@ -61,9 +61,9 @@ def serialize_soi(soi):
serialized = {
"title": soi.title,
"description": soi.description,
"date": soi.date,
"version": soi.version,
"valid": {"from": soi.valid_from, "to": soi.valid_to},
"date": soi.date,
"valid": {"from_date": soi.valid_from, "to_date": soi.valid_to},
"icon": soi.icon,
"classification": soi.classification,
"orientation": soi.orientation,
......@@ -179,8 +179,8 @@ def import_soi(file_path):
serialized["description"],
serialized["version"],
serialized["date"],
serialized["valid"]["from"],
serialized["valid"]["to"],
serialized["valid"]["from_date"],
serialized["valid"]["to_date"],
serialized["icon"],
serialized["classification"],
serialized["orientation"],
......
......@@ -55,9 +55,9 @@ SCHEMA = Schema(
{
"title": And(str, len),
"description": str,
"date": Or(str, None),
"version": And(str, len),
"valid": {"from": Or(str, None), "to": Or(str, None)},
"date": Or(str, None),
"valid": {"from_date": Or(str, None), "to_date": Or(str, None)},
"icon": Or(str, None),
"classification": And(str, len),
"orientation": And(str, len, Or("portrait", "landscape")),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment