Esempio n. 1
0
 def is_displayed_in_other_tab(self, attribute, o_Class):
   Prop = PROPS.get(attribute.name)
   if Prop: 
     for Class in o_Class.mro():
       values_lister = VALUES_LISTERS.get((Prop, Class))
       if values_lister:
         other_tab_classes = list(self.instance_editor.edited_classes)
         other_tab_classes.remove(self.tab_edited_class)
         #if attribute.name == "population": print("=> ", values_lister.range_match_classes(other_tab_classes))
         return values_lister.range_match_classes(other_tab_classes)
   #if attribute.name == "population": print("=> False (pas trouvé)")
   return False
Esempio n. 2
0
 def is_displayed_in_other_tab(self, attribute, o_Class):
     Prop = PROPS.get(attribute.name)
     if Prop:
         for Class in o_Class.mro():
             values_lister = VALUES_LISTERS.get((Prop, Class))
             if values_lister:
                 other_tab_classes = list(
                     self.instance_editor.edited_classes)
                 other_tab_classes.remove(self.tab_edited_class)
                 #if attribute.name == "population": print("=> ", values_lister.range_match_classes(other_tab_classes))
                 return values_lister.range_match_classes(other_tab_classes)
     #if attribute.name == "population": print("=> False (pas trouvé)")
     return False
Esempio n. 3
0
 def _compute(self, o, attribute, field_class = None):
   o_Class = o.__class__
   if field_class is None: field_class = attribute.field_class_for(o)
   
   displayed_in_another_tab = False
   Prop = PROPS.get(attribute.name)
   if Prop:
     if isinstance(o, type): mro = o.mro()
     else:                   mro = o_Class.mro()
     for Class in mro:
       values_lister = VALUES_LISTERS.get((Prop, Class))
       if values_lister:
         other_tab_classes = list(self.instance_editor.edited_classes)
         other_tab_classes.remove(self.tab_edited_class)
         #if attribute.name == "population": print("=> ", values_lister.range_match_classes(other_tab_classes))
         displayed_in_another_tab = values_lister.range_match_classes(other_tab_classes)
         break
         
   displayed_in_hierarchy_pane = field_class.display_in_hierarchy_pane and not(displayed_in_another_tab)
   displayed_in_attribute_pane = field_class.display_in_attribute_pane or      displayed_in_another_tab
   self._cache[o_Class, attribute.name] = displayed_in_hierarchy_pane, displayed_in_attribute_pane