ignore trailing spaces in dc, add curriculum fields
[librarian.git] / librarian / dcparser.py
index 062dc9f..031a731 100644 (file)
@@ -95,6 +95,7 @@ class Field(object):
         self.default = kwargs.get('default', [] if multiple else [None])
 
     def validate_value(self, val, strict=False):
+        val = [v.strip() if v is not None else v for v in val]
         if strict and self.strict is not None:
             validator = self.strict
         else:
@@ -178,6 +179,9 @@ class WorkInfo(object):
         Field( DCNS('date.pd'), 'released_to_public_domain_at', as_date, required=False),
         Field( DCNS('publisher'), 'publisher'),
 
+        Field( DCNS('subject.competence'), 'competences', multiple=True, required=False),
+        Field( DCNS('subject.curriculum'), 'curriculum', multiple=True, required=False),
+
         Field( DCNS('language'), 'language'),
         Field( DCNS('description'), 'description', required=False),