Please enable JavaScript.
Coggle requires JavaScript to display documents.
django models, models (model (fields (field options (null, blank, default,…
django models
models
model
fields
field options
null
blank
default
choices
max_length
relationship fields
many to one (foreign key)
to
on_delete
cascade
et_null
related_name
backward relationship
can hide with '+'
can check using shell plus
many to many
one to one
field types
char
decimal
text
smallInteger
DateTime
meta options
attributes
methods
built-in
str
custom
inheritance
manager
managers
default manager
return all objects
override get_queryset() method to return queryset with properties you want
custom manager
manager methods
extend other manager
softDeleteManager
custom queryset with methods
add custom queryset to custom manager
filter by role
check whether an object belongs to a model, isinstance()
a method to create filter kwargs