agateblue / django-dynamic-preferences

Dynamic global and instance settings for your django project
https://django-dynamic-preferences.readthedocs.org/
BSD 3-Clause "New" or "Revised" License
350 stars 87 forks source link

Section's verbose_name not exposed over Rest API #230

Open ondrejkolin opened 4 years ago

ondrejkolin commented 4 years ago

Summary

Section's verbose_name is missing in JSON serialized object. I would like to use this value to display human-friendly content.

Details

Currently exposed data for a preference field

{
        "section": "company",
        "name": "companyname",
        "identifier": "company__companyname",
        "default": "My company",
        "value": "My company",
        "verbose_name": "Jméno společnosti",
        "help_text": "Plné jméno společnosti, použité jako první řádek adresy",
        "additional_data": {},
        "field": {
            "class": "CharField",
            "widget": {
                "class": "TextInput"
            },
            "input_type": "text"
        }
    },

Fix?

Introduce a new value with key section__verbose_name or section_verbose_name. As I don't like not using nested serializer, but it's better than breaking backwards compatibility.

Are you guys interested in a pull request? I could maybe try to build a one.