wrap around entire django ORM in all editor views
This commit is contained in:
parent
9e58a662e0
commit
7e78bf0550
4 changed files with 224 additions and 20 deletions
|
@ -31,7 +31,9 @@ class MapitemFormMixin(ModelForm):
|
|||
self.initial['geometry'] = json.dumps(mapping(self.instance.geometry), separators=(',', ':'))
|
||||
|
||||
if 'groups' in self.fields:
|
||||
LocationGroup = self.request.changeset.wrap('LocationGroup')
|
||||
self.fields['groups'].label_from_instance = lambda obj: obj.title_for_forms
|
||||
self.fields['groups'].queryset = LocationGroup.objects.all()
|
||||
|
||||
# parse titles
|
||||
self.titles = None
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue