On Aug 25, 2010, at 9:39 AM, Frank wrote: > Hello Michael, > > that worked well, thank you very much for your aid. I'm just having > trouble understanding why I need to do the None check. I thought from > my example that weight could'nt be None at all ... could you be so > kind to elaborate a bit what's happening behind the scene?
its nothing behind the scene - your example does not set any value for the "nutrient_weight" column, therefore the INSERT statement attempts to insert NULL. On the Python side this is None which is sent to your typedecorator for processing. > > When I tested the WeightType class with a simple example (Person -> > weight) it wasn't necessary. > > > Thank you > > Frank > > -- > You received this message because you are subscribed to the Google Groups > "sqlalchemy" group. > To post to this group, send email to sqlalch...@googlegroups.com. > To unsubscribe from this group, send email to > sqlalchemy+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/sqlalchemy?hl=en. > -- You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To post to this group, send email to sqlalch...@googlegroups.com. To unsubscribe from this group, send email to sqlalchemy+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en.