Use the attribute
objects
of models.
Here “objects” is a manager which takes care of all data lookup operation!
To fetch all objects, use
objects.all()
This will return the list of objects.
———
>>>card_list=Card.objects.all()
Use the attribute
objects
of models.
Here “objects” is a manager which takes care of all data lookup operation!
To fetch all objects, use
objects.all()
This will return the list of objects.
———
>>>card_list=Card.objects.all()
Django data model has an attribute objects
that can be used to perform queries on that model.
E.g.,
Card.objects.all()
Card.objects.filter(name__icontains=query)
etc.
This will provide a list of Card objects that matched the query (whose name contains query).
