Changes between Version 11 and Version 12 of new_meta_api
- Timestamp:
- Jul 11, 2014, 6:35:23 AM (10 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
new_meta_api
v11 v12 134 134 {{{ 135 135 def get_fields(self, m2m=False, data=True, related_m2m=False, related_objects=False, virtual=False, 136 include_parents=True, include_non_concrete=True, include_hidden=False, include_proxy=False, recursive=False):136 include_parents=True, include_non_concrete=True, include_hidden=False, include_proxy=False, export_map=False): 137 137 }}} 138 138 … … 141 141 get_fields is internally cached for speed and a recursive function that collects fields from each parent of the model. 142 142 An example of every (sane) combination of flags will be available in the model_meta test suite that I will ship with the new API. 143 The 'export_map' key is only used internally (by get_field) and is not part of the public API. 'export_map=True' will return an OrderedDict with fields 144 as keys and a tuple of strings as values. While the keys map exactly to the same output as 'export_map=False', the tuple of values will contain all 145 possible lookup names for that field. This is used to build a fast lookup table for get_field and to avoid re-iterating over every field to pull 146 out every possible name. 143 147 144 148 {{{