[EMAIL PROTECTED] wrote:
I think you can do the same with the class method.
SO(**dict)
as it is the same as
SO(key1=a, key2=b)
If you have a schema that matches the database fields, you can :
d = dbSchema(allow_extra_fields=True,
filter_extra_fields=true).to_python(kw )
SO(**d) # if you want to add
so.set(**d) # if you want to update
The schema to_python function would filter out fields it doesn't know.
Personally, I just scrape the database metaclass to create such a
schema so I don't even need to define one line by line and any changes
to the database table definition would be retrieved.
Thank you. I'll try that out. In particular, it was bothering me
having separate validation definitions in the model and in the
controllers that would have to be kept in sync. Not very DRY.
Much appreciated!
-Steve