#25768: Cast Variable, and provide multiplication
-------------------------------+----------------------------
     Reporter:  BenLiyanage    |      Owner:  nobody
         Type:  Uncategorized  |     Status:  new
    Component:  Uncategorized  |    Version:  1.8
     Severity:  Normal         |   Keywords:  QuerySet.extra
 Triage Stage:  Unreviewed     |  Has patch:  0
Easy pickings:  0              |      UI/UX:  0
-------------------------------+----------------------------
 Hey,

 I'm trying to do an orm query and have run into two scenarios where I
 believe I need to use extra.  The two scenarios are:

 == Type Casting

 Casting a column to an int. Specifically, I have a boolean column that I
 need to do something like this:

     select column::int

 == Multiplication

 I need to multiply a column by a constant, or another column.
 Specifically the column from the previous cast.

     select new_column * -1
     select column1 * column2

 == Full Select Example

 Ultimately I need to combine the above two like this:

     select bool_column::int * -1 * another_int_column

--
Ticket URL: <https://code.djangoproject.com/ticket/25768>
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 django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/054.19d7ad8e505984cc218963bda2c6d8ee%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to