Changes between Version 2 and Version 4 of Ticket #31124


Ignore:
Timestamp:
Dec 27, 2019, 5:16:48 AM (5 years ago)
Author:
Mariusz Felisiak
Comment:

Thanks for an extra info. I was able to reproduce this issue, e.g.

>>> B.objects.create(field_foo='A').get_field_foo_display()
output1
>>> B.objects.create(field_foo='B').get_field_foo_display()
output2
>>> B.objects.create(field_foo='C').get_field_foo_display()
C

Regression in 2d38eb0ab9f78d68c083a5b78b1eca39027b279a (Django 2.2.7).

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #31124

    • Property Resolution needsinfo
    • Property Status closednew
    • Property Cc Carlton Gibson Sergey Fedoseev added
    • Property Triage Stage UnreviewedAccepted
    • Property Version 2.23.0
  • Ticket #31124 – Description

    v2 v4  
    88{{{
    99class A(models.Model):
    10    foo_choice = Choices(("A","output1"),("B","output2"))
     10   foo_choice = [("A","output1"),("B","output2")]
    1111   field_foo = models.CharField(max_length=254,choices=foo_choice)
    1212   class Meta:
    13        abstract:True
     13       abstract = True
    1414
    1515class B(A):
    16    foo_choice = Choices(("A","output1"),("B","output2"),("C","output3"))
     16   foo_choice = [("A","output1"),("B","output2"),("C","output3")]
    1717   field_foo = models.CharField(max_length=254,choices=foo_choice)
    1818}}}
Back to Top