Opened 17 years ago

Closed 17 years ago

#4606 closed (invalid)

newforms-admin: Admin inserts '' (two apostrophes) instead of NULL into a CharField with null=True

Reported by: Matthias Pronk <django@…> Owned by: Adrian Holovaty
Component: contrib.admin Version: newforms-admin
Severity: Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

If I insert a record using the admin interface with a blank input field (CharField with blank=True and null=True) it appears as (two apostrophes) in my database instead of NULL.

Branch: newforms-admin (rev. 5488)
Database backend: postgresql_psycopg2

Change History (1)

comment:1 by Malcolm Tredinnick, 17 years ago

Resolution: invalid
Status: newclosed

It's not possible to tell whether the form user intended an empty string or a NULL in these cases, so Django has to make a choice. We always store empty strings for character fields. See the null documentation (the second paragraph explains this).

Note: See TracTickets for help on using tickets.
Back to Top