Code

Opened 7 years ago

Closed 7 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:

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

Attachments (0)

Change History (1)

comment:1 Changed 7 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).

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.