1.

How to get a particular item in the Model?

Answer»

ModelName.objects.get(id=”term”)
Note: If there are no RESULTS that match the query, get() will RAISE a DoesNotExist EXCEPTION. If more than ONE item matches the given get() query. In this case, it’ll raise MultipleObjectsReturned, which is also an attribute of the MODEL class itself.



Discussion

No Comment Found