[Erp5-dev] [Erp5-report] r17867 - /erp5/trunk/products/ERP5Type/patches/sqlvar.py

bartek bartek at erp5.pl
Wed Jan 2 16:37:01 CET 2008


Ivan Tyagov wrote:
> Hi,
> 
> bartek wrote:
>> Hi
>>
>> I have a problem with this change - when it is applied, activities are 
>> not executed. On the HEAD version with this one reverted everything 
>> works fine. From what I found out, it is because the value of "now" 
>> supplied by activity tool to sql methods is being converted to UTC, 
>> which means 1 hour is subtracted (my machine is set to GMT+1), in effect 
>> the activity tool executes only messages which are older then one hour :)
> 
> Did you update CMFActivity as well ?

Yes, everything is r18569.

> 
>> Has this patch been tested on a machine using timezone other then GMT?
> Yes, GTM+2. it works as expected as well all other test suites regarding 
> activities.

Doesn't work for me, though. Maybe it hits only older sites which are 
being upgraded? Do you want some debugging info?

Bartek

> 
> Regards
> Ivan
> 
> 
>> Bartek
>>
>> nobody at svn.erp5.org wrote:
>>> Author: ivan
>>> Date: Wed Nov 28 15:17:14 2007
>>> New Revision: 17867
>>>
>>> URL: http://svn.erp5.org?rev=17867&view=rev
>>> Log:
>>> Convert explicitly DateTime values to UTC.
>>>
>>> Modified:
>>>     erp5/trunk/products/ERP5Type/patches/sqlvar.py
>>>
>>> Modified: erp5/trunk/products/ERP5Type/patches/sqlvar.py
>>> URL: http://svn.erp5.org/erp5/trunk/products/ERP5Type/patches/sqlvar.py?rev=17867&r1=17866&r2=17867&view=diff
>>> ==============================================================================
>>> --- erp5/trunk/products/ERP5Type/patches/sqlvar.py (original)
>>> +++ erp5/trunk/products/ERP5Type/patches/sqlvar.py Wed Nov 28 15:17:14 2007
>>> @@ -19,6 +19,7 @@
>>>  from string import atoi,atof
>>>  from types import StringType
>>>  from Products.ERP5Type.PsycoWrapper import psyco
>>> +from DateTime import DateTime
>>>  
>>>  def SQLVar_render(self, md):
>>>      name=self.__name__
>>> @@ -70,17 +71,15 @@
>>>  
>>>          try:
>>>              if getattr(v, 'ISO', None) is not None:
>>> -                v=v.ISO()
>>> -            elif getattr(v, 'strftime', None) is not None:
>>> -                v=v.strftime('%Y-%m-%d %H:%M:%S')
>>> -            else: 
>>> -                v=str(v)
>>> +                v=v.toZone('UTC').ISO()
>>> +            else:
>>> +                v = DateTime(v)
>>> +                v=v.toZone('UTC').ISO()
>>>          except:
>>>              if not v and args.has_key('optional') and args['optional']:
>>>                  return 'null'
>>>              raise ValueError, (
>>>                  'Invalid datetime value for <em>%s</em>: %r' % (name, v))
>>> -
>>>          v=md.getitem('sql_quote__',0)(v)
>>>      # End of patch
>>>      else:
>>>
>>> _______________________________________________
>>> Erp5-report mailing list
>>> Erp5-report at erp5.org
>>> http://mail.nexedi.com/mailman/listinfo/erp5-report
>>>
>>
> 
> 


-- 
"feelings affect productivity. (...) unhappy people write worse 
software, and less of it."
Karl Fogel, "Producing Open Source Software"



More information about the Erp5-dev mailing list