filter from databse list

15 views
Skip to first unread message

Mahantesh U

unread,
Oct 29, 2013, 4:54:15 AM10/29/13
to django...@googlegroups.com
Hi,

   I'm using chcekboxes for 3 location india,china,usa in my form. The selected filed are stoiring in database in list like:  location: ['india','china', 'usa']


1st row in databse:  ['india']
2nd row in databse:  ['india', 'china']
3rd row in databse:  ['india', 'china', 'usa']


in my views.py file:
 
  faculty_list = serializers.serialize("json", camp_faculty.objects.all().filter(location=location_param))

  By calling API:
     
        HTTP://localhost:8000/fetchform/<location_param>

       The above API returning only data where location=india

  But If i pass location_param='india' I want all the all the three rows from database. How can i achieve this?

 Pls let me know the solution.


Thanks
mahantesh




Reply all
Reply to author
Forward
0 new messages