I have to fetch multiple rows from database based on some condition. There may be one row in database for matching query or multiple rows. I can use get() for one row but it does not fetch multiple rows.
Here is my code:
value=table.objects.get(col_name=1) then i can access its data as value.col but as i said it gives me error if this query returns more then one row.
I have also tried filter() , value=table.objects.filter(col_name=1) but then i can't access its data as value.col.
So please suggest me some way how i can fetch multiple rows from database and access columns one by one of those rows.
Thanks !!