def parse_json_option(self, json_option):
     """ parses json option to populate
         this object
     """
     if 'id' in json_option:
         self.id = json_option['id']
     if 'json' in json_option:
         self.json = json_option['json']
     if 'label' in json_option:
         self.label = json_option['label']
     if 'count' in json_option:
         self.count = json_option['count']
     if 'slug' in json_option:
         self.slug = json_option['slug']
     if 'rdfs:isDefinedBy' in json_option:
         if 'http://' in json_option['rdfs:isDefinedBy'] \
            or 'https://' in json_option['rdfs:isDefinedBy']:
             # assign this to a subheading
             self.set_sub_heading(json_option['rdfs:isDefinedBy'])
             rp = RootPath()
             self.defined_by = rp.convert_local_url(json_option['rdfs:isDefinedBy'])
     self.dom_id = self.dom_id_prefix + '---' + str(self.slug)
     # check to see if we should show this, based in if this is a related property
     # and if self.item_type_limited is False
     self.check_show_related_options()
 def parse_json_option(self, json_option):
     """ parses json option to populate
         this object
     """
     if 'id' in json_option:
         self.id = json_option['id']
     if 'json' in json_option:
         self.json = json_option['json']
     if 'label' in json_option:
         self.label = json_option['label']
     if 'count' in json_option:
         self.count = json_option['count']
     if 'slug' in json_option:
         self.slug = json_option['slug']
     if 'rdfs:isDefinedBy' in json_option:
         if 'http://' in json_option['rdfs:isDefinedBy'] \
            or 'https://' in json_option['rdfs:isDefinedBy']:
             # assign this to a subheading
             self.set_sub_heading(json_option['rdfs:isDefinedBy'])
             rp = RootPath()
             self.defined_by = rp.convert_local_url(
                 json_option['rdfs:isDefinedBy'])
     self.dom_id = self.dom_id_prefix + '---' + str(self.slug)
     # check to see if we should show this, based in if this is a related property
     # and if self.item_type_limited is False
     self.check_show_related_options()
 def parse_json_option(self, json_option):
     """ parses json option to populate
         this object
     """
     if 'id' in json_option:
         self.id = json_option['id']
     if 'json' in json_option:
         self.json = json_option['json']
     if 'label' in json_option:
         self.label = json_option['label']
     if 'count' in json_option:
         self.count = json_option['count']
     if 'slug' in json_option:
         self.slug = json_option['slug']
     if 'rdfs:isDefinedBy' in json_option:
         if 'http://' in json_option['rdfs:isDefinedBy'] \
            or 'https://' in json_option['rdfs:isDefinedBy']:
             rp = RootPath()
             self.defined_by = rp.convert_local_url(json_option['rdfs:isDefinedBy'])
     self.dom_id = self.dom_id_prefix + '---' + str(self.slug)
Example #4
0
 def parse_json_option(self, json_option):
     """ parses json option to populate
         this object
     """
     if 'id' in json_option:
         self.id = json_option['id']
     if 'json' in json_option:
         self.json = json_option['json']
     if 'label' in json_option:
         self.label = json_option['label']
     if 'count' in json_option:
         self.count = json_option['count']
     if 'slug' in json_option:
         self.slug = json_option['slug']
     if 'rdfs:isDefinedBy' in json_option:
         if 'http://' in json_option['rdfs:isDefinedBy'] \
            or 'https://' in json_option['rdfs:isDefinedBy']:
             rp = RootPath()
             self.defined_by = rp.convert_local_url(
                 json_option['rdfs:isDefinedBy'])
     self.dom_id = self.dom_id_prefix + '---' + str(self.slug)