#32977: conditionalize Class Meta. I want to achieve something like this. How 
can i
do it?
----------------------------------+--------------------------------------
     Reporter:  hellorahulnarang  |                    Owner:  nobody
         Type:  Uncategorized     |                   Status:  closed
    Component:  Uncategorized     |                  Version:  3.2
     Severity:  Normal            |               Resolution:  invalid
     Keywords:                    |             Triage Stage:  Unreviewed
    Has patch:  0                 |      Needs documentation:  0
  Needs tests:  0                 |  Patch needs improvement:  0
Easy pickings:  0                 |                    UI/UX:  0
----------------------------------+--------------------------------------
Changes (by Mariusz Felisiak):

 * status:  new => closed
 * resolution:   => invalid


Old description:

> if self.name_format == "First name Last name":
>             class Meta:
>                 ordering = ['first_name', 'last_name']
>         elif self.name_format == "Last name First name":
>             class Meta:
>                 ordering = ["last_name","first_name"]
>         elif self.name_format == "Last name, First name":
>             class Meta:
>                 ordering = ["last_name","first_name"]
>         else:
>             class Meta:
>                 ordering = ["first_name","last_name"]

New description:

 {{{
         if self.name_format == "First name Last name":
             class Meta:
                 ordering = ['first_name', 'last_name']
         elif self.name_format == "Last name First name":
             class Meta:
                 ordering = ["last_name","first_name"]
         elif self.name_format == "Last name, First name":
             class Meta:
                 ordering = ["last_name","first_name"]
         else:
             class Meta:
                 ordering = ["first_name","last_name"]
 }}}

--

Comment:

 Please don't use Trac as a support channel. Closing per
 TicketClosingReasons/UseSupportChannels.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/32977#comment:1>
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/074.f17e6a002e92a93538c83ab9c12d471c%40djangoproject.com.

Reply via email to