Im a newbie to Django and would like to understand what is the difference between filter vs get
Get
Entry.objects.get(id__exact=14)
<
Basically use get
when you want to get a single unique object, and filter when you want to get all objects that match your lookup parameters
__data = User.objects.get(is_active=1).exclude(id=id)
Error:get() returned more than one User -- it returned 19!, Type:
------successful-------
__data = User.objects.filter(is_active=1).exclude(id=id)
-------successful------
Check the Link