gozoinks / pyfilemaker

Automatically exported from code.google.com/p/pyfilemaker
0 stars 0 forks source link

'datetime.datetime' object has no attribute 'hasattr' #16

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Find and modify a row with a datetime.datetime value
2. Save the row via doEdit()
3. Voilà the error

What is the expected output? What do you see instead?
It should save the row but fails because of an error in FMServer.py, on line 
510.

What version of the product are you using? On what operating system?
PyFileMaker 2.6, Python 2.7.5, OS X 10.8.5

Please provide any additional information below.
This patch on FMServer.py fixes it:
@@ -507,7 +507,7 @@

                elif hasattr(dbParam[1], 'strftime'):
                    d = dbParam[1]
-                   if (not d.hasattr(d, 'second')) and (d.second + d.minute * 60 + d.hour * 
3600) == 0:
+                   if (not hasattr(d, 'second')) and (d.second + d.minute * 60 + d.hour * 
3600) == 0:
                        request.append( uu( { dbParam[0]: d.strftime('%m-%d-%Y') } ) )
                    else:
                        request.append( uu( { dbParam[0]: d.strftime('%m-%d-%Y %H:%M:%S') } ) )

Original issue reported on code.google.com by a...@team.shoeboxed.com on 30 Jan 2014 at 10:14