Changes between Initial Version and Version 1 of Ticket #33602
- Timestamp:
- Mar 26, 2022, 10:47:35 AM (3 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #33602
- Property Component contrib.admin → Database layer (models, ORM)
- Property Resolution → needsinfo
- Property Status new → closed
- Property Type Uncategorized → Bug
-
Ticket #33602 – Description
initial v1 1 1 \site-packages\django\db\backends\mysql\operations.py line 58 2 2 {{{ 3 3 def date_trunc_sql(self, lookup_type, field_name, tzname=None): 4 4 field_name = self._convert_field_to_tz(field_name, tzname) … … 8 8 } # Use double percents to escape. 9 9 10 11 the problem is here. 10 }}} 11 the problem is here. 12 {{{ 12 13 'year': '%%Y-01-01', 13 14 'month': '%%Y-%%m-01', 15 }}} 14 16 17 this will generate the SQL. 15 18 16 this will generate the sql. 19 {{{ 17 20 SELECT DISTINCT CAST(DATE_FORMAT([table name], '%%Y-01-01') AS DATE) AS `datefield 21 }}} 18 22 23 the format `''%%Y-01-01''` is not right for mysql. 19 24 20 the format ''%%Y-01-01'' is not right for mysql.21