update model object django code example
Example 1: django update model
Model.objects.filter(id = 223).update(field1 = 2)
Example 2: django pk
pk stands the "primary key" in django which represents a models ID.
The ID attribute is generated for you automatically behind the scences
for each model and any newly created instances after that.
Example 3: django id
The ID in django is a "unique identifier" for each models instances.
You do not need to explicitly add a ID field to your own models as
the ID attribute is automatically generated for you behind the scences
by django for each new model and any newly created instances of that
model afterwards.