Esempio n. 1
0
 def format_property(self, key, property):
     if isinstance(property, datetime.datetime):
         return property.strftime(USER_DATE_FORMAT)
     if key == "namespace":
         return get_namespace_name(self.document_instance.domain, property)
     return super(IndicatorAdminCRUDManager,
                  self).format_property(key, property)
Esempio n. 2
0
 def available_indicators(self):
     indicators = []
     for namespace in get_namespaces(self.domain):
         indicators.extend(
             self.indicator_class.get_all_of_type(namespace, self.domain))
     return [(i._id, "%s | v. %d | n: %s" %
              (i.slug, i.version if i.version else 0,
               get_namespace_name(i.domain, i.namespace)))
             for i in indicators]
Esempio n. 3
0
 def available_indicators(self):
     indicators = []
     for namespace in get_namespaces(self.domain):
         indicators.extend(self.indicator_class.get_all_of_type(namespace, self.domain))
     return [(i._id, "%s | v. %d | n: %s" % (i.slug, i.version if i.version else 0,
                                             get_namespace_name(i.domain, i.namespace))) for i in indicators]
Esempio n. 4
0
 def format_property(self, key, property):
     if isinstance(property, datetime.datetime):
         return property.strftime(USER_DATE_FORMAT)
     if key == "namespace":
         return get_namespace_name(self.document_instance.domain, property)
     return super(IndicatorAdminCRUDManager, self).format_property(key, property)