Changes between Version 2 and Version 4 of Ticket #31124


Ignore:
Timestamp:
12/27/2019 05:16:48 AM (18 months 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 Status changed from closed to new
    • Property Version changed from 2.2 to 3.0
    • Property Cc Carlton Gibson Sergey Fedoseev added
    • Property Resolution changed from needsinfo to
    • Property Triage Stage changed from Unreviewed to Accepted
  • 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