wimglenn / djangorestframework-queryfields

Allows clients to control which fields will be sent in the API response
http://djangorestframework-queryfields.readthedocs.io/
MIT License
215 stars 16 forks source link

getting particular nested fields not working using this fields filtering #23

Closed shafiyal closed 5 years ago

shafiyal commented 5 years ago

My GET body is like below: GET : /images

 {
        "id": 1,
        "images": [
            {
                "image": "e3942bf0-6c6.png",
                "width": 353,
                "height": 200,
                "size": 168306,
                "aspect_ratio": 1.765,
                "rendition": null
            }
         ]
}

I want to filter only width and height fields i.e., GET:/images?fields=width,height

Expected result:

 {
                "width": 353,
                "height": 200
}

But i am unable to specify nested fields while filtering fields How can I acheive this??

wimglenn commented 5 years ago

dupe of https://github.com/wimglenn/djangorestframework-queryfields/issues/8

shafiyal commented 5 years ago

I have seen #8 but did not get any solution for my problem , can you please clarify whether the nested fields filtering is supported by this package or not?

wimglenn commented 5 years ago

To clarify: nested field filtering is not supported by this package. It might be added at a later date.

shafiyal commented 5 years ago

ok... Thanks

yezyilomo commented 5 years ago

Well for the mean time you can try django-restql.