Changes between Initial Version and Version 1 of Ticket #31512


Ignore:
Timestamp:
Apr 24, 2020, 6:28:32 AM (5 years ago)
Author:
Mariusz Felisiak
Comment:

== works properly for me, e.g.

class Event(models.TextChoices):
    C = 'Carnival!'
    F = 'Festival!'

>>> p1 = Post.objects.create(title=Event.C)
>>> p1.title == Event.C
True

I wouldn't expect that is will work here.

The current solution seems, sadly, hacky at best.

Please try to be more polite and appreciate the effort of contributors.

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #31512

    • Property Resolutioninvalid
    • Property Status newclosed
  • Ticket #31512 – Description

    initial v1  
    55This probably isn't the most beautiful thing though, and it wasn't really stated that this is the defacto way to check for equality (lest i use `self.year_in_school in self.YearInSchool.JUNIOR.value`.
    66
    7 It would be quite nice if the `self.year_in_school` type actually was of type ENUM, or atleast had documented how you could check for equality with them.
     7It would be quite nice if the `self.year_in_school` type actually was of type ENUM, or at least had documented how you could check for equality with them.
    88
    99The current solution seems, sadly, hacky at best.
Back to Top