Opened 7 years ago

Closed 7 years ago

Last modified 4 years ago

#8674 closed (duplicate)

OneToOne Fields display problem in admin gui

Reported by: nekron Owned by: nobody
Component: contrib.admin Version: master
Severity: Keywords: OneToOne
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

This bug is for SVN 8696.

I created the following simple OneToOneField model:

class Man(models.Model):
    name = models.CharField(max_length=10)
    def __unicode__(self):
        return self.name

class Woman(models.Model):
    name = models.CharField(max_length=10)
    man = models.OneToOneField(Man)
    def __unicode__(self):
        return self.name

e.g., a woman is married to one man.

If I register both models with admin.site.register and start editing them via administration I can add woman to man 1:1 relations, however if I start editing my womens objects again I get "--------" instead of my related man object shown in the select box. Within the database the OneToOneField data looks ok.

Change History (3)

comment:1 Changed 7 years ago by kmtracey

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

This is covered by #8562, I believe. There's a patch on that ticket you could try to verify.

comment:2 Changed 7 years ago by nekron

Yep, patch 8562_onetoone_attname.diff worked for me! Thanks!!

comment:3 Changed 4 years ago by jacob

  • milestone 1.0 deleted

Milestone 1.0 deleted

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