def get_lookups(self, prefix='', models=None): models = models or [] lookups = get_lookups(self.model, self.exclude_fields, prefix, models) for related_filter in self.related: rel_model = related_filter.model path = models_to_path([self.model, rel_model]) lookups.extend(related_filter.get_lookups(prefix + path + '__', models + [rel_model])) return lookups
def get_prefix(self): if not self.path: return '' return models_to_path(self.path) + '__'
def get_forms(self, prefix=''): forms = [self.get_form(prefix)] for related_filter in self.related: path = models_to_path([self.model, related_filter.model]) forms.extend(related_filter.get_forms(prefix + path + '__')) return forms