def related_entity_map(self): """Return a dictionary of field_name:related_entity_set pairs.""" d = odict() for name, field in self.items(): if field.may_store_entities: d[name] = field._entities_in_value() return d
def value_map(self): """Return a dictionary of field_name:field_value pairs.""" d = odict() for name, field in self.items(): # Do not use field.get() here because we want the value to # be stored in the database, not the value that is exposed # to users. # # XXX: Is this comment and implementation accurate # anymore, now that we use dump_map for that purpose? d[name] = field._value return d
def dump_map(self): """Return a dictionary of field_name:dumped_value pairs.""" d = odict() for name, field in self.items(): d[name] = field._dump() return d
def _criteria(self): criteria = odict() for name, field in self.s.field_map().iteritems(): if field.assigned: criteria[name] = field.get() return criteria