How to factorize common fields with deform/colander ?
题
I need to display two forms depending on the context. The second form should contain a name and email text input followed by the first form content in that order, but only when the user is not authenticated.
I tried with Python class inheritance but in every tested cases the two new fields were displayed after the content of the first form.
Is there a way to correcly factorise common fields in deform forms or to specify a different display order?
解决方案
The solution is probably to define the schema imperatively:
http://docs.pylonsproject.org/projects/colander/en/latest/basics.html#defining-a-schema-imperatively
不隶属于 StackOverflow