[Zope3-dev] forms and schemas

Steve Alexander steve@cat-box.net
Wed, 19 Feb 2003 12:43:38 +0200


>>There is no form: namespace that I know about.
> 
> The presentation in /Docs in the cvs mention one...

Then it needs updating.


>>One approach -- code generation -- is in src/zope/app/schemagen
> 
> I will have a look at this! Thank you very much!

schemagen is incomplete at present.


>>You can also construct an interface object that has fields. This is 
>>easier, and is fine provided you don't need your schema to be resolved 
>>at a particular dotted-module-name.
> 
> I need to build the schema at runtime, because the set of fields may
> vary!

Do you need to say that objects implement this schema, or are you using 
it only to describe forms?

If the former, then you'll need to use something like schemagen.
If the latter, then you can create an interface with the fields you 
require in it.

Interfaces should be viewed as being immutable -- you shouldn't try to 
change the fields or attibutes described by an interface after it has 
been constructed.

--
Steve Alexander