Bug 60

Title: Expression in AtTimeZone
Type: crash Severity: normal
Components: Versions:
Status: closed Resolution:
Dependencies: Superseder:
Assigned To: ced Nosy List: ced, risto3, roundup-bot
Priority: normal Keywords: patch

Created on 2018-05-14 15:10 by ced, last changed 2018-05-16 23:52 by roundup-bot.

msg71 Author: [hidden] (ced) Date: 2018-05-14 15:10
It is allowed to use expression as timezone name for AtTimeZone.

msg72 Author: [hidden] (ced) Date: 2018-05-14 15:11
Here is review48331002
msg73 Author: [hidden] (risto3) Date: 2018-05-14 15:52
I will try this, but I ask as well, I tried for readability
to get extra parens for the expression, e.g.

   select ((date at time zone 'UTC') at time zone

but nothing seemed to work... the result is always without

perhaps line 479 in sql/ could read:

       return '(%s AT TIME ZONE %s)' % (str(self.field), zone)

wouldn't that do it?
msg74 Author: [hidden] (ced) Date: 2018-05-14 16:24
There is no need for parenthesis, it is valid SQL without.
As it is generated SQL code, we do not add syntactic sugar.
msg75 Author: [hidden] (risto3) Date: 2018-05-14 16:47
ok, agreed.

for what it is worth, the patch works for me. +1
msg76 Author: [hidden] (roundup-bot) Date: 2018-05-16 23:52
New changeset f76ee6f5d2a7 by C├ędric Krier in branch 'default':
Allow to use expression in AtTimeZone
Date User Action Args
2018-05-16 23:52:26roundup-botsetstatus: open -> closed
nosy: + roundup-bot
messages: + msg76
2018-05-14 16:47:35risto3setmessages: + msg75
2018-05-14 16:24:15cedsetmessages: + msg74
2018-05-14 15:52:28risto3setnosy: + risto3
messages: + msg73
2018-05-14 15:11:46cedsetstatus: new -> open
keywords: + patch
messages: + msg72
2018-05-14 15:10:56cedcreate