Opened 18 years ago

Closed 18 years ago

Last modified 18 years ago

#2558 closed defect (duplicate)

forms.RawIdAdminField fails with NoneType on split()

Reported by: anonymous Owned by: Adrian Holovaty
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: no UI/UX: no

Description

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?

Change History (1)

comment:1 by Russell Keith-Magee, 18 years ago

Resolution: duplicate
Status: newclosed

Duplicates #2579, fixed in [3803].

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