Issue 15 in salesforce-beatbox: Does not marshall time fields correctly

3 Aufrufe
Direkt zur ersten ungelesenen Nachricht

codesite...@google.com

ungelesen,
11.09.2013, 11:18:3011.09.13
an plo...@googlegroups.com
Status: New
Owner: ----

New issue 15 by patr...@deadlypenguin.com: Does not marshall time fields
correctly
http://code.google.com/p/salesforce-beatbox/issues/detail?id=15

What steps will reproduce the problem?
1. Query a Case with a time field from BusinessHours (ie
BusinessHours.MondayStartTime)
2. Will fail during .query call

What is the expected output? What do you see instead?
The data marshalled into a datetime.time


--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings

codesite...@google.com

ungelesen,
11.09.2013, 11:53:1911.09.13
an plo...@googlegroups.com

Comment #1 on issue 15 by patr...@deadlypenguin.com: Does not marshall time
fields correctly
http://code.google.com/p/salesforce-beatbox/issues/detail?id=15

It appears to be as easy as adding to following to marshall.py

timeregx = re.compile(r'(\d{2}):(\d{2}):(\d{2})(\.\d+)(.*)') # Line 12

# Line 115
def timeMarshaller(fieldname, xml, ns):
timestr = str(xml[getattr(ns,fieldname)])
match = timeregx.match(timestr)
if match:
grps = match.groups()
hour = int(grps[0])
minute = int(grps[1])
second = int(grps[2])
secfrac = float(grps[3])
microsecond = int(secfrac * (10**6))
tz = grps[4] # XXX not sure if I need to do anything with this.
sofar
# times appear to be UTC
return datetime.time(hour, minute, second, microsecond)
return None


register('time', timeMarshaller)
Allen antworten
Antwort an Autor
Weiterleiten
0 neue Nachrichten