[web2py] Re: as_dict() on a row fails when connected to MySQL on Amazon RDS

2015-07-03 Thread Robert Porter
Could you show your DB code for reference?  And you should jump in appadmin 
to check just what has been uploaded to the DB to be sure.

On Wednesday, 1 July 2015 07:01:19 UTC-7, Sean Ballow wrote:

 We are connecting successfully to MySQL on RDS

 And when attempting to insert a new record it appears to properly insert 
 into the database and we receive an ID back, for instance

 result = db.foo.insert(myfield='blah')

 print result
  1

 The problem occurs when performing the following after successfully 
 inserting a record and committing it

 result.as_dict()
  TypeError: 'NoneType' object is not callable

 result is a ROW instance and the following continues to work

 print result.id
  1

 however as_dict() fails only when connected to MySQL on RDS and not when 
 using the MySQL local instance

 Oddly enough when I use the same application connected to a locally 
 running instance of MySQL we do not receive the exception and everything 
 works as desired.

 Any ideas what may be causing the disparity between a connection to a 
 local MySQL instance and a MySQL RDS instance? I have compared system 
 variables between both databases and was unable to identify a problem

 Thanks for your help



-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: as_dict() on a row fails when connected to MySQL on Amazon RDS

2015-07-02 Thread Niphlod
I'm pretty sure that 

newly_inserted_id = db.table.insert(...)

should return an integer, not a row.

On Wednesday, July 1, 2015 at 4:01:19 PM UTC+2, Sean Ballow wrote:

 We are connecting successfully to MySQL on RDS

 And when attempting to insert a new record it appears to properly insert 
 into the database and we receive an ID back, for instance

 result = db.foo.insert(myfield='blah')

 print result
  1

 The problem occurs when performing the following after successfully 
 inserting a record and committing it

 result.as_dict()
  TypeError: 'NoneType' object is not callable

 result is a ROW instance and the following continues to work

 print result.id
  1

 however as_dict() fails only when connected to MySQL on RDS and not when 
 using the MySQL local instance

 Oddly enough when I use the same application connected to a locally 
 running instance of MySQL we do not receive the exception and everything 
 works as desired.

 Any ideas what may be causing the disparity between a connection to a 
 local MySQL instance and a MySQL RDS instance? I have compared system 
 variables between both databases and was unable to identify a problem

 Thanks for your help



-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.