#29745: Argument based equality check of BaseExpression causes unstable 
migration
state
-------------------------------------+-------------------------------------
     Reporter:  bacilla              |                    Owner:  Simon
                                     |  Charette
         Type:  Bug                  |                   Status:  assigned
    Component:  Migrations           |                  Version:  2.0
     Severity:  Normal               |               Resolution:
     Keywords:  migration meta       |             Triage Stage:  Accepted
  ordering expression                |
    Has patch:  1                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  1
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------

Comment (by Simon Charette):

 @bacilla by the way a less invasive workaround is to pass
 `Cast(output_field)` as a keyword argument instead of a positional one.

 {{{#!python
 class TestEntity(models.Model):
     some_property = models.TextField()

     class Meta:
         ordering = (
             Cast(models.Func(models.F('some_property'),
 models.Value('^\d+'), function='SUBSTRING'),
 output_field=models.IntegerField()),
             Right(Concat(models.Value('00000'),
 models.F('some_property')), models.Value(5))
         )
 }}}

-- 
Ticket URL: <https://code.djangoproject.com/ticket/29745#comment:7>
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/068.33604324995f36f387e2c6855af577e0%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to