move slug to LocationSlug serializer
This commit is contained in:
parent
92003080ed
commit
4803704cec
1 changed files with 8 additions and 1 deletions
|
@ -33,6 +33,14 @@ class LocationSlug(SerializableMixin, models.Model):
|
|||
pass
|
||||
return None
|
||||
|
||||
def get_slug(self):
|
||||
return self.slug
|
||||
|
||||
def _serialize(self, **kwargs):
|
||||
result = super()._serialize(**kwargs)
|
||||
result['slug'] = self.get_slug()
|
||||
return result
|
||||
|
||||
class Meta:
|
||||
verbose_name = _('Slug for Location')
|
||||
verbose_name_plural = _('Slugs für Locations')
|
||||
|
@ -52,7 +60,6 @@ class Location(LocationSlug, EditorFormMixin, models.Model):
|
|||
|
||||
def _serialize(self, **kwargs):
|
||||
result = super()._serialize(**kwargs)
|
||||
result['slug'] = self.get_slug()
|
||||
result['titles'] = self.titles
|
||||
result['can_search'] = self.can_search
|
||||
result['can_describe'] = self.can_search
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue