def exclude(self, field_types):
     fields = OrderedDict([
         (slug, field) for slug, field in self._fields.items()
         if slug in self._custom_fields
         and self._custom_fields[slug].field_type not in field_types
     ])
     return iter(compat.itervalues(fields))
 def exclude(self, field_types):
     fields = OrderedDict([
         (slug, field) for slug, field in self._fields.items()
         if slug in self._custom_fields and
         self._custom_fields[slug].field_type not in field_types
     ])
     return iter(compat.itervalues(fields))
 def filter(self, field_types=None):
     if field_types is None:
         field_types = []
     fields = OrderedDict([
         (slug, field) for slug, field in self._fields.items()
         if slug in self._custom_fields
         and self._custom_fields[slug].field_type in field_types
     ])
     return iter(compat.itervalues(fields))
示例#4
0
 def __iter__(self):
     """Iterate form fields in creation order."""
     return iter(itervalues(self._fields))
示例#5
0
 def __iter__(self):
     """Iterate form fields in creation order."""
     return iter(itervalues(self._fields))
示例#6
0
 def __iter__(self):
     """ Iterate form fields in arbitrary order """
     return iter(itervalues(self._fields))
示例#7
0
 def __iter__(self):
     """ Iterate form fields in arbitrary order """
     return iter(itervalues(self._fields))
示例#8
0
 def __iter__(self):
     '''
     reorder form fields based on __order
     '''
     __ordered = OrderedDict([(k, self._fields[k]) for k in self.__order])
     return iter(itervalues(__ordered))