Tor Hildrum schrieb:
> On Oct 18, 10:10 pm, Gregor Horvath <[EMAIL PROTECTED]> wrote:
> 
> 
>>def dict_to_attr(dict_, object_):
>>  valid_attributes = object_.sqlmeta.columns.keys()
>>  for attr, value in dict_.iteritems():
>>    if attr in valid_attributes:
>>        setattr(object_, attr, value)
>>
> 
> 
> This saves me a lot of work, but how do I get the type?
> I still need to cast for my IntCols.
> 
> Can I just get the column value from the object and check it's type?
> 

The type is already correct when the dict comes to this function,
because I am working with FormEncode and this converts the
                       dict values to the correct types.

--
Greg

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TurboGears" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/turbogears
-~----------~----~----~----~------~----~------~--~---

Reply via email to