Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Tastypie filtering with multiple values

I had a simple question on filtering in tastypie.

I want to filter with multiple values. For example:

/api/v1/message/?accountId=1,5,12

This doesnt work. Any idea how i can do this?

Do i need to use advanced filtering? If yes, how do I go about creating such a filter? A simple effortless example of puesdo-code would be great!

Thanks!

like image 212
nknj Avatar asked Jul 11 '12 15:07

nknj


1 Answers

Hmm,

You can do this:

/api/v1/message/?accountId__in=1&accountId__in=5&accountId__in=12

PS: in filtering meta attribute, add {'accountId': ALL}

like image 197
Vinicius Cainelli Avatar answered Sep 19 '22 01:09

Vinicius Cainelli