automatic = False # whether the field is automatically created ("magic" field)
inherited = False # whether the field is inherited (_inherits)
column = None # the column interfaced by the field
+ setup_done = False # whether the field has been set up
name = None # name of the field
type = None # type of the field (string)
def reset(self):
""" Prepare `self` for a new setup. """
- self._setup_done = False
+ self.setup_done = False
# self._triggers is a set of pairs (field, path) that represents the
# computed fields that depend on `self`. When `self` is modified, it
# invalidates the cache of each `field`, and registers the records to
and other properties). This method is idempotent: it has no effect
if `self` has already been set up.
"""
- if not self._setup_done:
- self._setup_done = True
+ if not self.setup_done:
+ self.setup_done = True
self._setup(env)
def _setup(self, env):
for fname, field in self._fields.iteritems():
if allfields and fname not in allfields:
continue
+ if not field.setup_done:
+ continue
if field.groups and not recs.user_has_groups(field.groups):
continue
res[fname] = field.get_description(recs.env)