reimplement wrapped prefetch_related

This commit is contained in:
Laura Klünder 2017-06-16 18:19:52 +02:00
parent 19856dfd8a
commit 8fef2a81a9
5 changed files with 35 additions and 20 deletions

View file

@ -26,7 +26,7 @@ class SerializableMixin(models.Model):
result = OrderedDict()
if include_type:
result['type'] = self.__class__.__name__.lower()
result['id'] = self.id
result['id'] = self.pk
return result

View file

@ -20,7 +20,7 @@ class GeometryMixin(EditorFormMixin):
def get_geojson_properties(self) -> dict:
result = OrderedDict((
('type', self.__class__.__name__.lower()),
('id', self.id),
('id', self.pk),
))
if getattr(self, 'bounds', False):
result['bounds'] = True