Comment

Comment by ninjapenguin54

I've read the django docs. It's dumb advice parading as "best practice".

The idea that empty string and none are equivalent is distasteful.

Nobody makes this argument for int fields right? "Just use 0"?

I hate having different conventions for different field types and losing a potentially meaningful distinction between empty string and 0.

The idea seems to be born out of truthy & falsey values. (A big source of gotchas and bugs in my experience)

I'd say it's the role of django forms to clean data into a normalized form. So converting null to empty string there might make sense.

No comments yet

Be the first to share your thoughts.

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton