I have a table Documents
and it has a field named type
and the type has two data's namely - type1 & type2
Now my requirements is - i have a bootstrap tabs type1 & type2
, and i need to display data accordingly on the template
Which is efficient way to do this ?
Using two variables
data = Documents.objects.filter(id=pk)
type1 = data.filter(type="type1")
type2 = data.filter(type="type2")
and then pass it to context
context = { "type1":type1,"type2":type2 }
Is there any other best way to do this ?