Apologies, I am completely new to Django and Python.
I have 2 questions. First, how would I go about getting the last object created (or highest pk) in a list of objects? For example, I know that I could use the following to get the first object:
list = List.objects.all()[0]
Is there a way to get the length of List.objects? I've tried List.objects.length but to no avail.
Second, is it possible to create simultaneous filters or combine lists? Here is an example:
def findNumber(request, number)
phone_list = Numbers.objects.filter(cell=number)
I want something like the above, but more like:
def findNumber(request, number)
phone_list = Numbers.objects.filter(cell=number or home_phone=number)
What is the correct syntax, if any?