Re: [colander] "proper" declarative with collection nodes in schemas

2011-05-03 Thread Chris Withers
On 03/05/2011 18:12, Gustavo Fonseca wrote: There are lots of situations where the same data structure should be used, and I think your suggestion would make them less reusable. Agreed, so how about this class decorator as an alternative: class instantiate: def __init__(self,*args,**kw):

Re: [colander] "proper" declarative with collection nodes in schemas

2011-05-03 Thread Gustavo Fonseca
Hi Chris, There are lots of situations where the same data structure should be used, and I think your suggestion would make them less reusable. For example in a book catalog you can have the same struture for Authors in both, the Book class and the Chapter class. cheers, Gustavo. On Tue, May 3,

[colander] "proper" declarative with collection nodes in schemas

2011-05-03 Thread Chris Withers
Hi All, We currently have to do: """ class Friend(colander.TupleSchema): rank = colander.SchemaNode(colander.Int(), validator=colander.Range(0, )) name = colander.SchemaNode(colander.String()) class Friends(colander.SequenceSchema): friend = Friend(