add location→types API endpoint
This commit is contained in:
parent
6bbac4a7ba
commit
40375585e1
3 changed files with 32 additions and 17 deletions
|
@ -14,6 +14,15 @@ class EditorFormMixin(models.Model):
|
|||
def serialize(self, **kwargs):
|
||||
return self._serialize(**kwargs)
|
||||
|
||||
@classmethod
|
||||
def serialize_type(cls, **kwargs):
|
||||
return OrderedDict((
|
||||
('name', cls.__name__.lower()),
|
||||
('name_plural', cls._meta.default_related_name),
|
||||
('title', str(cls._meta.verbose_name)),
|
||||
('title_plural', str(cls._meta.verbose_name_plural)),
|
||||
))
|
||||
|
||||
def _serialize(self, include_type=False, **kwargs):
|
||||
result = OrderedDict()
|
||||
if include_type:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue