Opened 8 years ago

Closed 8 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
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: UI/UX:


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 Changed 8 years ago by mtredinnick

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Resolution set to invalid
  • Status changed from new to closed

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