Skip to content

Instantly share code, notes, and snippets.

View Vaiterius's full-sized avatar
🙃
no internship

Gerard Gandionco Vaiterius

🙃
no internship
View GitHub Profile
@InterStella0
InterStella0 / HelpCommand_walkthrough_guide.md
Last active June 4, 2024 18:06
Walkthrough guide on subclassing HelpCommand
@ekinertac
ekinertac / field_blank_null.md
Last active May 28, 2024 05:50
Django null/blank field explanation
Fields null=True blank=True
CharField, TextField, SlugField, EmailField, CommaSeparatedIntegerField DON'T Django's convention is to store empty values as the empty string, and to always retrieve NULL or empty values as the empty string for consistency. OK Do this if you want the corresponding form widget to accept empty values. If you set this, empty values get stored as empty strings in the database.
BooleanField DON'T Use NullBooleanField instead. DON'T
IntegerField, FloatField, DecimalField OK If you wabt to be able to set the value to NULL in the database OK if you want the corresponding form widget to accept empty values. if so out will also want to set null=True
DateTimeField, DateField, TimeField OK if you want to be able to set the value to NULL in the database. OK If you want the corresponding form widget to accept empty values, or if you are using auto now or auto now add. If so, you will al