Changes between Version 11 and Version 12 of new_meta_api


Ignore:
Timestamp:
Jul 11, 2014, 6:35:23 AM (10 years ago)
Author:
pirosb3
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • new_meta_api

    v11 v12  
    134134{{{
    135135    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):
    137137}}}
    138138
     
    141141get_fields is internally cached for speed and a recursive function that collects fields from each parent of the model.
    142142An example of every (sane) combination of flags will be available in the model_meta test suite that I will ship with the new API.
     143The '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
     144as 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
     145possible 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
     146out every possible name.
    143147
    144148{{{
Back to Top