Opened 18 years ago

Closed 9 years ago

#2948 closed New feature (fixed)

Better OneToOneField handling in Admin Interface desired

Reported by: wam-djangobug@… Owned by: nobody
Component: contrib.admin Version: newforms-admin
Severity: Normal Keywords: nfa-someday
Cc: evh293@…, erwin@…, robillard.etienne@…, ekellner@…, someone@…, philipp@…, cmawebsite@…, wonlay@…, brooks.travis@…, stephane@… Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: yes


Currently, a one to one relationship renders as a drop down box to select a instance of the related object type. If no object exists of the related type exists, the drop down box is empty with no easy way to create the object. There is no plus mark like there is for ForeignKey.

At the very least, I feel a Plus mark in the user interface associated with the OneToOneField is necessary to make the admin interface usable.

Ideally, since this is a OneToOne relationship, the fields for the related class could be brought directly into the admin interface of the object "extending" the "base" object. I tried specifying edit_inline in my OneToOne field; however, that seemed to want to put my extending class into admin interface of the extended class. If someone creates an object with a OneToOneField, then they are almost certainly want to know and be able to edit the field values of the object that is being extended.

Change History (11)

comment:1 by Jacob, 16 years ago

Triage Stage: UnreviewedAccepted
Version: newforms-admin

comment:2 by Malcolm Tredinnick, 16 years ago

Just in case anybody wants to work on this too soon: OneToOne has been slightly refactored on the queryset-refactor branch, so if any of these changes need altering of the OneToOneField code, some coordination will be required (e.g. wait until after the merge).

comment:3 by Karen Tracey <kmtracey@…>, 16 years ago

Keywords: nfa-someday added

comment:4 by brooks.travis@…, 16 years ago

Cc: evh293@… erwin@… robillard.etienne@… ekellner@… someone@… philipp@… cmawebsite@… wonlay@… brooks.travis@… added

From what I can tell, the admin now has a "+" next to the Select for a OneToOneField. The behavior the reporter talks about, with regard to having the parent model's fields in the edit page for the child, is how newforms-admin handles multi-table-inheritance relationships. The only potential issue that might still exist is the inability for the framework, in general, to handle creating a child model instance against an existing parent, a la #7623. That said, I'd say this ticket could probably be closed.

comment:5 by anonymous, 16 years ago

Cc: stephane@… added

comment:6 by Łukasz Rekucki, 13 years ago

Severity: normalNormal
Type: enhancementNew feature

comment:7 by Julien Phalip, 13 years ago

UI/UX: set

comment:8 by Aymeric Augustin, 12 years ago

UI/UX: unset

Change UI/UX from NULL to False.

comment:9 by Aymeric Augustin, 12 years ago

Easy pickings: unset

Change Easy pickings from NULL to False.

comment:10 by Aymeric Augustin, 12 years ago

UI/UX: set

Revert accidental batch modification.

comment:11 by Tim Graham, 9 years ago

Resolution: fixed
Status: newclosed

Closing per comment #4.

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