Posts by André Luiz • 101 points
1 post
-
0
votes2
answers119
viewsA: Attribute name referring to secondary key in a model in Django
You can use city.state.pk Django by default always creates an attribute internally pk which points to the primary key of that model, this can even be used in the method get State.objects.get(pk=123)…