Changes between Initial Version and Version 1 of Ticket #32418


Ignore:
Timestamp:
Feb 4, 2021, 5:38:10 AM (4 years ago)
Author:
Hoshi Yamazaki
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #32418 – Description

    initial v1  
    11My code:
    2 ```python
     2
     3
     4{{{
    35duration_expression = ExpressionWrapper(
    46    datetime.timedelta(minutes=1) * F('duration'),
     
    2426    Q(Q(booking_end__lte=first_interval),
    2527      Q(booking_end__gte=next_interval)))
    26 ```
     28}}}
     29
     30
    2731
    2832Error I get:
    29 ```
     33
     34
     35{{{
    3036(1064, "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '* `carwashes_carwashbooking`.`duration`) MICROSECOND) AS `booking_end` FROM `car' at line 1")
    31 ```
     37}}}
     38
    3239
    3340SQL query:
    34 ```sql
     41
     42
     43{{{
    3544('SELECT `carwashes_carwashbooking`.`id`, '
    3645 '`carwashes_carwashbooking`.`carwash_id`, '
     
    5463 'MICROSECOND * `carwashes_carwashbooking`.`duration`) MICROSECOND) >= %s))) '
    5564 'LIMIT 21')
    56 ```
     65}}}
     66
     67
    5768
    5869Stackoverflow issue: https://stackoverflow.com/questions/66044255/django-returns-sql-syntax-error-when-using-expressionwrapper-and-f-expressions
Back to Top