[Answer]-Making queries for a single row table in Django

1👍

Case 2 works fine, because the arguments for the get() function are optional. If you don’t provide anything, it will match against every record. Since you table only has one, it raises no exception.

See the docs: https://docs.djangoproject.com/en/1.7/ref/models/querysets/#get

Your case 1 should be working, though. Check if your info is in your context for the template.

Leave a comment