Thomas Kumlehn <[EMAIL PROTECTED]> wrote:
> Hello Ian,
> 
> I recently installed your latest FunFormKit into
> Webware 0.6a1.
> GREAT STUFF - thanks for providing this kit.
> 
> I've got some questions and a bug report.
> 
> First the bug:
> The Examples/Register.py does not return the favorite
> color as a tuple, but only a single number.
> I guess fields can only handle a single value.
> Or did you want to show this limitation ;-)

No, that was a bug :)  I haven't been paying enough attention to my
own examples.  I'll put this together the fix together with the
passthrough feature Jeff wanted later today.

> Q 1:
> fields.items() returns kind of randomly ordered
> It's neighter in alphabetical nor in the order of
> declaration. I'm happy the order is preserved for
> .htFormTable()

Where are you getting fields from?

If you get the renderableForm and ask if for .fields() it'll give you
a list of the fields, ordered as the original.  This is how
.htFormTable() does it.

> Q 2:
> Did someone already add a FormDefinition generator to 
> MiddleKit/Design/Generate.py ?
> Just to create a rough framework.
> If not - any hints how a sample formDef, FormServlet
> subclasses to add, edit, view MiddleKit persistent
> objects should look like are welcome.
> Or do you think it's not worth it - better always do
> it manually.

No, no such thing exists.  I've thought about making such a thing, but
haven't even starting thinking about how it would work.

First thing would be to create a list of fields based on the fields in
the model.  Everything after that is a bit more specific to the exact
thing you are doing -- editting, inserting, etc.

I don't believe the model (currently) has a place where you can
provide greater annotation as to what values are valid.  I.e., you can
tell the model an int is valid, but not that is must be between 1 and
10.  It would be appropriate to add this to the model, and then
generate the field (with validators) off of that.  With a bit of work,
I suppose you would also want to have the generated class assert those
same validations, to guard from programmer error as well as input
error.

  Ian

_______________________________________________
Webware-discuss mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/webware-discuss

Reply via email to