how to retrieve a single objects with get() method part 11 | Django in deep

preview_player
Показать описание
filter() will always give you a #QuerySet, even if only a single object matches the query - in this case, it will
be a #queryset containing a single element.
If you know there is only one object that matches your query, you can use the #get() method on a Manager
which returns the object directly

00:00 intro
02:13 HTML TEMPLATE clean up
03:32 how to use get() method to retrieve a single object with a specific primary key
06:05 how to use get() method when you are expecting multiple objects to be returned
06:47 how to use the get() method on a Foreignkey
09:51 how to use the get() method on a manytomany field
Рекомендации по теме
Комментарии
Автор

Without watching full video you deserve like

ne-su