#30280: Model_get_FIELD_display() returns proxies in 2.2rc1 but always returned
strings previously
-------------------------------------+-------------------------------------
     Reporter:  Matthias Kestenholz  |                    Owner:  nobody
         Type:  Bug                  |                   Status:  new
    Component:  Database layer       |                  Version:  2.2
  (models, ORM)                      |
     Severity:  Release blocker      |               Resolution:
     Keywords:                       |             Triage Stage:  Accepted
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------

Comment (by Matthias Kestenholz):

 You're right, thanks. I could have explained it better.

 [https://github.com/django/django/pull/11109 PR]

 The code which failed was:

 {{{
 class Project(Model):
     ACQUISITION = "acquisition"

     TYPE_CHOICES = [
         (ACQUISITION, _("Acquisition")),
         ...
     ]

     type = models.CharField(_("type"), choices=TYPE_CHOICES,
 max_length=20)
     closed_on = models.DateField(_("closed on"), blank=True, null=True)

     def pretty_status(self):
         parts = [self.get_type_display()]
         if self.closed_on:
             parts.append(
                 gettext("closed on %s") %
 local_date_format(self.closed_on, "d.m.Y")
             )
         return ", ".join(parts)
 }}}

-- 
Ticket URL: <https://code.djangoproject.com/ticket/30280#comment:3>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/067.7c78dc8a4e868cc88b0e36e8f00a2a79%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to