Hi Conrad,
I've built a django app to build queries like this. The one that is 
available on github right now is somewhat specific to my initial use case, 
but I plan on releasing a new, much more modular version of it this week. 
If you want to take a look at it and use it, or wait for the update, or 
just take ideas from it, here it is:

https://github.com/ckirby/django-modelqueryform

~C. Kirby 

On Tuesday, April 1, 2014 6:16:05 AM UTC-5, Conrad Rowlands wrote:
>
> Hi All. I wonder if anyone can point me in the right direction. I am 
> building a web api using django and FilterSets and wish to allow consumers 
> to perform a query along the lines of 
>
> Manufacturer =x OR manufacturer = y etc etc
>
> Is this achievable out of the box and how would you specify this within 
> the url? My current url looks like this
>
> http://127.0.0.1:8000/compare/api/instance/?Manufacturer=x&Manufacturer=y
>
> but this only performs an AND on the underlying data
>
> Manufacturer =x AND manufacturer = y etc etc
>
> Also, please note that whilst I would like to perform an OR with regard to 
> the manufacturer if I include other fields to be queried I would expect 
> these to be AND'd for example
>
>
> http://127.0.0.1:8000/compare/api/instance/?Manufacturer=x&Manufacturer=yModel=z
>
> should equate to 
>
> (Manufacturer =x OR manufacturer = y) AND Model = z
>
> Thanks In advance
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/0e36096f-9927-4ab9-96d7-e66dc5e1c77a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
  • Filtersets Conrad Rowlands
    • Re: Filtersets C. Kirby

Reply via email to