bhch / django-jsonform

A better, user-friendly JSON editing form field for Django admin. Also supports Postgres ArrayField.
https://django-jsonform.rtfd.io
BSD 3-Clause "New" or "Revised" License
307 stars 31 forks source link

Add option for additionalProperties keys to not be changed in the display #115

Closed alexgmin closed 11 months ago

alexgmin commented 11 months ago

Using the same example from https://github.com/bhch/django-jsonform/issues/114

Schema

{
    'type': 'dict',
    'title': 'Language ISO 2 letter code',
    'properties': {},
    'additionalProperties': {
        'type': 'dict',
        'title': 'Translation',
        'properties': {},
        'additionalProperties': {
            'type': 'string',
        },
    },
}

Display image

In this case, "Original name" internally is original_name image

Ideally there should be an option for the display of the key to not be "beautified" for cases like this. In this example the ISO language code is also lowercase, so ideally that would also be shown lowercase in this case.

bhch commented 11 months ago

Yeah, I had also been a bit unsure about this when I first added this "feature".

Displaying the key names as they are seems a better approach.

Or maybe add an option something like: {'title': '__auto__'} to "beautify" the name.

I'll try to release a fix in a couple of days.

bhch commented 11 months ago

Fixed in v2.18.0. Please upgrade and test it out.

Thank you for reporting the issue.