Convert the self.deferred_loading data structure to an alternate data structure, describing the field that *will* be loaded. This is used to compute the columns to select from the database and also by the QuerySet class to work out which fields are being initialized
(self)
| 875 | return select_mask |
| 876 | |
| 877 | def get_select_mask(self): |
| 878 | """ |
| 879 | Convert the self.deferred_loading data structure to an alternate data |
| 880 | structure, describing the field that *will* be loaded. This is used to |
| 881 | compute the columns to select from the database and also by the |
| 882 | QuerySet class to work out which fields are being initialized on each |
| 883 | model. Models that have all their fields included aren't mentioned in |
| 884 | the result, only those that have field restrictions in place. |
| 885 | """ |
| 886 | field_names, defer = self.deferred_loading |
| 887 | if not field_names: |
| 888 | return {} |
| 889 | mask = {} |
| 890 | for field_name in field_names: |
| 891 | part_mask = mask |
| 892 | for part in field_name.split(LOOKUP_SEP): |
| 893 | part_mask = part_mask.setdefault(part, {}) |
| 894 | opts = self.get_meta() |
| 895 | if defer: |
| 896 | return self._get_defer_select_mask(opts, mask) |
| 897 | return self._get_only_select_mask(opts, mask) |
| 898 | |
| 899 | def table_alias(self, table_name, create=False, filtered_relation=None): |
| 900 | """ |
no test coverage detected