Added method Wrapper.isEmpty(name) that checks if the content of some field is empty or not on a given object.
This commit is contained in:
parent
5b255ce55d
commit
e13575c506
|
@ -178,7 +178,8 @@ class Group(ModelClass):
|
||||||
roles = gen.String(validator=gen.Selection('getGrantableRoles'),
|
roles = gen.String(validator=gen.Selection('getGrantableRoles'),
|
||||||
multiplicity=(0,None), **m)
|
multiplicity=(0,None), **m)
|
||||||
users = gen.Ref(User, multiplicity=(0,None), add=False, link=True,
|
users = gen.Ref(User, multiplicity=(0,None), add=False, link=True,
|
||||||
back=gen.Ref(attribute='groups', show=User.showRoles),
|
back=gen.Ref(attribute='groups', show=User.showRoles,
|
||||||
|
multiplicity=(0,None)),
|
||||||
showHeaders=True, shownInfo=('title', 'login'))
|
showHeaders=True, shownInfo=('title', 'login'))
|
||||||
|
|
||||||
# The Translation class --------------------------------------------------------
|
# The Translation class --------------------------------------------------------
|
||||||
|
|
BIN
gen/ui/doc.png
BIN
gen/ui/doc.png
Binary file not shown.
Before Width: | Height: | Size: 818 B After Width: | Height: | Size: 829 B |
BIN
gen/ui/odt.png
BIN
gen/ui/odt.png
Binary file not shown.
Before Width: | Height: | Size: 754 B After Width: | Height: | Size: 784 B |
|
@ -125,6 +125,14 @@ class AbstractWrapper(object):
|
||||||
return customUser.__dict__[methodName](self, *args, **kwargs)
|
return customUser.__dict__[methodName](self, *args, **kwargs)
|
||||||
|
|
||||||
def getField(self, name): return self.o.getAppyType(name)
|
def getField(self, name): return self.o.getAppyType(name)
|
||||||
|
def isEmpty(self, name):
|
||||||
|
'''Returns True if value of field p_name is considered as being
|
||||||
|
empty.'''
|
||||||
|
obj = self.o
|
||||||
|
if hasattr(obj.aq_base, name):
|
||||||
|
field = obj.getAppyType(name)
|
||||||
|
return field.isEmptyValue(getattr(obj, name))
|
||||||
|
return True
|
||||||
|
|
||||||
def link(self, fieldName, obj):
|
def link(self, fieldName, obj):
|
||||||
'''This method links p_obj (which can be a list of objects) to this one
|
'''This method links p_obj (which can be a list of objects) to this one
|
||||||
|
|
Loading…
Reference in a new issue