예제 #1
0
파일: ref.py 프로젝트: Sateanu/django-sis
 def isShowable(self, obj, layoutType):
     res = Field.isShowable(self, obj, layoutType)
     if not res: return res
     # We add here specific Ref rules for preventing to show the field under
     # some inappropriate circumstances.
     if (layoutType == 'edit') and \
        (self.mayAdd(obj) or not self.link): return False
     if self.isBack:
         if layoutType == 'edit': return False
         else: return getattr(obj.aq_base, self.name, None)
     return res
예제 #2
0
 def isShowable(self, obj, layoutType):
     res = Field.isShowable(self, obj, layoutType)
     if not res: return res
     # We add here specific Ref rules for preventing to show the field under
     # some inappropriate circumstances.
     if (layoutType == 'edit') and \
        (self.mayAdd(obj) or not self.link):
         return False
     if self.isBack:
         if layoutType == 'edit': return False
         else: return getattr(obj.aq_base, self.name, None)
     return res
예제 #3
0
 def isShowable(self, obj, layoutType):
     if layoutType == 'edit': return
     return Field.isShowable(self, obj, layoutType)