Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Fields" param in settings #24

Open
plopidou opened this issue May 22, 2018 · 1 comment
Open

"Fields" param in settings #24

plopidou opened this issue May 22, 2018 · 1 comment

Comments

@plopidou
Copy link

plopidou commented May 22, 2018

Hello,

An idea that would be nice: the ability to set the GET param names in settings. Something like the default:

DRF_DYNAMIC_FIELDS_GET_NAMES = ['fields', 'omit]

Which could be overriden in the local settings with something like:

DRF_DYNAMIC_FIELDS_GET_NAMES = ['__fields', '__omit]

So that the risk of the GET param colliding with model fields named "fields" and "omit" is minimised when using drf_dynamic_fields alongside https://github.com/carltongibson/django-filter, for example.

Thanks!

@dbrgn
Copy link
Owner

dbrgn commented May 22, 2018

Sounds like a nice idea. Although a dictionary for configuration would probably be better:

DRF_DYNAMIC_FIELDS = {
    'GET_PARAMETERS': {
        'fields': '__fields',
        'omit': '__omit',
    },
}

Pull requests (including tests and documentation) are welcome. If someone has any questions regarding implementation, feel free to ask!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants