Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

django queryset count

# Returns the total number of entries in the database.
count = Entry.objects.count()

# Returns the number of entries whose headline contains 'Lennon'
count = Entry.objects.filter(headline__contains='Lennon').count()
Source by docs.djangoproject.com #
 
PREVIOUS NEXT
Tagged: #django #queryset #count
ADD COMMENT
Topic
Name
8+3 =