python - Django-Rest-Framework field naming remap -
i have python classes written in pythonic naming conventions (e.g. multiple_words_with_underscores
). when exposed through django-rest-framework, want redo naming convention camelcase
more javascript-esque. there built in way django-rest-framework serializers or need explicitly name columns?
i know how can achieve list comprehension , model._meta.fields attribute, want know if there specific built-in way accomplish this.
you can use djangos field.verbose_name attribute this:
name = models.charfield(max_length=100, verbose_name='new name')
this automatically used in post/put forms not in object representation. can have frontend use parameter necessary show labels wish
Comments
Post a Comment