Q: Django ORM에서 queryset과 object의 차이점에 대해서 설명하시오
A:
object는 하나의 객체, queryset은 object들의 list
Django QuerySet
A QuerySet is a collection of data from a database.
A QuerySet is built up as a list of objects.
QuerySets makes it easier to get the data you actually need, by allowing you to filter and order the data at an early stage.
https://www.w3schools.com/django/django_queryset.php
QuerySets represent a collection of objects from the database and can be constructed, filtered, sliced, or generally passed around without actually hitting the database.
https://blog.logrocket.com/querysets-and-aggregations-in-django/
Q: Django ORM에서 정참조와 역참조에 대해서 설명하시오
A:
https://junghogit.github.io/django/django-orm-relation/
https://docs.djangoproject.com/en/4.2/topics/db/queries/#related-objects
'TIL' 카테고리의 다른 글
TIL 072823 (0) | 2023.07.28 |
---|---|
TIL 072723 (0) | 2023.07.27 |
TIL 072523 (0) | 2023.07.25 |
TIL 072423 (0) | 2023.07.24 |
TIL 072123 (0) | 2023.07.24 |