Check if an object exists
Since filter returns a QuerySet, you can use count to check how many results were returned. This is assuming you don’t actually need the results. After looking at the documentation though, it’s better to just call len on your filter if you are planning on using the results later, as you’ll only be making one sql query: A count() call … Read more