Skip to content

Instantly share code, notes, and snippets.

View Vaiterius's full-sized avatar
🔥
Seeking new-grad software jobs

Gerard Gandionco Vaiterius

🔥
Seeking new-grad software jobs
View GitHub Profile
@ekinertac
ekinertac / field_blank_null.md
Last active December 4, 2024 06:03
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
@InterStella0
InterStella0 / HelpCommand_walkthrough_guide.md
Last active March 1, 2025 19:04
Walkthrough guide on subclassing HelpCommand