Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#2558 closed defect (duplicate)

forms.RawIdAdminField fails with NoneType on split()

Reported by: anonymous Owned by: adrian
Component: Core (Other) Version:
Severity: normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:


A snippet of my model is that I have a 'person' who can have one or more 'address'es associated, and vice versa. (Many people live at the same address, yes?) Therefore, I have a model that requires a ManyToManyField to be treated as a raw_id_admin, because data size creates real performance issues. I also render the 'address' data on a custom form using a render_raw_admin_id in templatetags.

When adding a new instance of 'person', we do not have any 'address'es associated as yet; So when I save the 'person', I get the NoneType failure on the split.

I have managed to get around this by adding a check for None in the RawIdAdminField.html2python, and returning an empty list if true.

Am I missing the point here?

Attachments (0)

Change History (1)

comment:1 Changed 8 years ago by russellm

  • Resolution set to duplicate
  • Status changed from new to closed

Duplicates #2579, fixed in [3803].

Add Comment

Modify Ticket

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

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

Note: See TracTickets for help on using tickets.