I have a query which is filtered by type, “fruits”
fruits = { apple, orange, mangoes, pineapples, etc }
however in this situation, each type of fruit held different items as well.
(for devs: properties of a domain within the server)
http://i46.tinypic.com/35kj1o7.png
note:
– the type of fruit can vary by days, some fruits are not in season.
– for devs: individual servers may hold a different number of domains
– numType field to dynamically determine how many different “fruits” are available that day
main objective:
– display and sort available data into tables.
http://i48.tinypic.com/infhip.png
On view.py,I do 2 raw sql queries
- Select * from main where cat ==’fruit’
- Select * from main where cat ==’fruit’ && name=’numType’
thanks in advance!
Not sure I entirely follow the question, but try taking a look at the documentation on Django template for loops, you can loop over key/value pairs with that tag.
If it’s more complicated than that, can you try giving a little more explanation?
Perhaps regroup will do what you’re looking for?