관리 메뉴

Silver Library (Archived)

[django] pk? id? metadata? 본문

Personal DB/Unclassified record

[django] pk? id? metadata?

Ayin Kim 2020. 12. 30. 16:28
반응형

stackoverflow.com/questions/2165865/django-queries-id-vs-pk

 

Django queries - id vs pk

When writing django queries one can use both id/pk as query parameters. Object.objects.get(id=1) Object.objects.get(pk=1) I know that pk stands for Primary Key and is just a shortcut, according to

stackoverflow.com

docs.djangoproject.com/en/3.1/topics/db/models/#meta-options

 

Models | Django documentation | Django

Django The web framework for perfectionists with deadlines. Overview Download Documentation News Community Code Issues About ♥ Donate

docs.djangoproject.com

 

'Personal DB > Unclassified record' 카테고리의 다른 글

jango - render  (0) 2021.01.05
django - getlist  (0) 2021.01.01
Caution - Django, space  (0) 2020.12.24
Django - class based view + function based view  (0) 2020.12.21
Django - class based view, ListView  (0) 2020.12.21