[Grok-dev] Working with Forms in Grok

Steve Schmechel steveschmechel at yahoo.com
Sat Feb 21 14:07:39 EST 2009


Thank you for writing this Kevin!  This has cleared up a lot of questions for me.  

I am not very familiar with Python/Zope3/Grok and I am having trouble taking all the "How-To's", which may each be fine their own context, and combining them into a working application that encompasses ideas from several "How-To's".  

Thank you for providing generously complete code samples rather than tiny snippets.  Also, thank you for including some of the documentation that is buried interfaces, doc strings, and readme files right in your tutorial.  (Yes, people can go find these documents on their own, but having them in front of you at the right time while you are learning is very helpful.)

I hope more of the Grok documentation begins to follow this style.  I am also hoping to put together a multi-part tutorial that documents several phases of creating a Grok application.  Hopefully, it will be similar to the existing tutorial, but cover more practical details of creating an application and evolving it from a quick prototype to something ready to deploy.  

I hope to post the application requirements some time next week.  Then I will work through the various phases, eliciting feedback from more experienced Grok developers as I go, and document the whole process in what should be a series of tutorials that build on one another.

The first phase will cover from setting up the initial project, to creating unit tests for the model code, to using auto-forms to prototype the initial model with real data.

Following phases would cover using custom templates and widgets to enhance the interface, adding roles and security, improving the look of the pages, administrative forms, and deployment.

For now, I have just been taking stabs at the auto-forms on a rough model.  My big question is how to use auto-forms to quickly handle nested objects.

For example, if a caveman wanted to track how much food his mammoth was consuming, we might have a collection of "feedings" for a given mammoth.  Each "feeding" object would have attributes for the "type of food" and the "weight".  For simplicity, both attributes could be just user-entered text but the feeding should be derived from grok.Model (not a list of string pairs or something like that).

It appears that zope.schema has "Container" type.  Assuming we just want to be able to record the feedings and view a simple listing for a given mammoth, what would be the quickest way to do this?


Thanks again,
Steve

--- On Fri, 2/20/09, Kevin Teague <kevin at bud.ca> wrote:

> From: Kevin Teague <kevin at bud.ca>
> Subject: [Grok-dev] Working with Forms in Grok
> To: grok-dev at zope.org
> Date: Friday, February 20, 2009, 2:28 PM
> I started to dump some tips on using Forms into the
> community docs,
> and ended up pumping out quite a bit of text, and now have
> the
> beginnings of a full blown tutorial:
> 
> http://grok.zope.org/documentation/tutorial/work-with-forms
> 
> If anyone is struggling to learn how to use Forms, give the
> tutorial a
> try and let me know what you still find confusing or
> missing. Or if
> you already know Forms quite well and want to contribute to
> the
> tutorial, you're quite welcome!
> 
> _______________________________________________
> Grok-dev mailing list
> Grok-dev at zope.org
> http://mail.zope.org/mailman/listinfo/grok-dev


      


More information about the Grok-dev mailing list