Correct new fields
authorymh <ymh.work@gmail.com>
Fri, 20 Sep 2013 03:08:34 +0200
changeset 105 62e4429f55cd
parent 104 b66ca6275115
child 106 71684a2ea502
Correct new fields
src/p4l/api/serializers.py
src/p4l/management/commands/import_record.py
src/p4l/templates/p4l/record_update_form.html
--- a/src/p4l/api/serializers.py	Fri Sep 20 02:51:43 2013 +0200
+++ b/src/p4l/api/serializers.py	Fri Sep 20 03:08:34 2013 +0200
@@ -133,7 +133,7 @@
         read_only_fields = ('identifier', 'uri')
         fields = ("identifier", "uri", "subjects", "notes", "otherLanguages",
                   "language", "editionStatement", "recordType", "isDocumentPart",
-                  "isHidden", "isRestricted", "themes", "countries", "projectNames", 
+                  "hidden", "restricted", "themes", "countries", "projectNames", 
                   "subjectCorporateBodies", "corporateAuthors", "corporateAuthorLabel", 
                   "imprints", "titles", "addedTitles", "issns", "isbns", "documentCodes",
                   "abstracts", "titlesMainDocument", "collations", "volumeIssues",
--- a/src/p4l/management/commands/import_record.py	Fri Sep 20 02:51:43 2013 +0200
+++ b/src/p4l/management/commands/import_record.py	Fri Sep 20 03:08:34 2013 +0200
@@ -133,11 +133,7 @@
         record.recordType = self.extract_single_value_form_graph(graph,"SELECT DISTINCT ?o WHERE { ?s dct:type ?o .}", bindings={'s':URIRef(record.uri)})
         record.isDocumentPart = self.extract_single_value_form_graph(graph,"SELECT DISTINCT ?o WHERE { ?s iiep:isDocumentPart ?o .}", bindings={'s':URIRef(record.uri)}, convert=self.convert_bool)
         record.hidden = self.extract_single_value_form_graph(graph,"SELECT DISTINCT ?o WHERE { ?s iiep:hidden ?o .}", bindings={'s':URIRef(record.uri)}, convert=self.convert_bool)
-        if record.hidden is None:
-            record.hidden = False
         record.restricted = self.extract_single_value_form_graph(graph,"SELECT DISTINCT ?o WHERE { ?s iiep:restricted ?o .}", bindings={'s':URIRef(record.uri)}, convert=self.convert_bool)
-        if record.restricted is None:
-            record.restricted = False
         record.editionStatement = self.extract_single_value_form_graph(graph,"SELECT DISTINCT ?o WHERE { ?s iiep:editionStatement ?o .}", bindings={'s':URIRef(record.uri)})
         record.corporateAuthorLabel = self.extract_single_value_form_graph(graph,"SELECT DISTINCT ?o WHERE { ?s iiep:corporateAuthorLabel ?o .}", bindings={'s':URIRef(record.uri)})
 
--- a/src/p4l/templates/p4l/record_update_form.html	Fri Sep 20 02:51:43 2013 +0200
+++ b/src/p4l/templates/p4l/record_update_form.html	Fri Sep 20 03:08:34 2013 +0200
@@ -212,11 +212,11 @@
     </tr>
     <tr>
       <td>{{ 'is hidden' | translate }}</td>
-      <td><input type="checkbox" ng-model="record.isHidden" /></td>
+      <td><input type="checkbox" ng-model="record.hidden" /></td>
     </tr>
     <tr>
       <td>{{ 'is restricted' | translate }}</td>
-      <td><input type="checkbox" ng-model="record.isRestricted" /></td>
+      <td><input type="checkbox" ng-model="record.restricted" /></td>
     </tr>
   </tbody>
 </table>