[Grok-dev] How to use auto-forms to quickly handle nested objects

Santiago Videla santiago.videla at gmail.com
Sun Mar 22 21:15:14 EDT 2009


Hi,


> Maybe there is some revelation that I have not experienced yet and I am
> handling this in completely the wrong way.
>
> If there is a better way to handle hierarchical relationships, please
> enlighten me.
>

I can't tell you too much about auto-forms, but maybe I can help you with
the relationships issues.

I'm working on a project with PostgreSQL instead of ZODB because I need an
easy way to handle that kind of relationships,1-N, N-N, delete objects with
cascade or restrict conditions, and all the stuff that PostgreSQL can do.

I'm using megrok.rdb[1] and it's working very well by now.

Hope it helps.

Best Regards

[1] http://svn.zope.org/megrok.rdb/



>
> If I just need to face the fact that this will be tough and I am going to
> need to learn a lot about adapters and write a bunch of code to make this
> happen, then tell me the hard truth.
>
> Thanks in advance,
> Steve
>
>
> > Hi Steve,
> >
> > In case you missed it, I think this may help
> >
> http://grok.zope.org/documentation/tutorial/work-with-forms/using-multiple-schemas-with-a-form
> >
> > It is an approach I'll be trying over the next few days
> > with a probelm
> > that is similar to yours.
> >
> > HTH,
> > Tim
> >
> >
> > On Sat, 2009-03-21 at 21:19 -0700, Steve Schmechel wrote:
> > > If you have a "grok.Model based" object that
> > contains one or more collections of other "grok.Model
> > based" objects, is there are way to quickly represent
> > this hierarchy using auto-forms?
> > >
> > > I cannot find any examples of this nested structure in
> > tutorials, how-to's, or example applications.  This
> > would seem to be a natural layout for many object domains.
> > >
> > > Is this generally handled differently?  Is everything
> > handled as "annotations"?  Is everything jammed in
> > the main application "grok.Container" and then
> > located as needed using separate indexes/catalogs?
> > >
> > > Take, for example, the mammoth example in:
> > >
> > http://grok.zope.org/documentation/tutorial/work-with-forms
> > >
> > > Mammoth(grok.Model) objects are stored in the
> > MammothApplication(grok.Application, grok.Container) and
> > auto-forms are used to view, add and edit mammoths.
> > >
> > > 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/fields 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 a
> > "Container" type and a "Dict" type.
> > > (grok.Container would map to Dict???)
> > > Assuming we just want to be able to record the
> > feedings and be able to view a simple listing of feedings
> > for a given mammoth, what would be the quickest way to do
> > this?
> > >
> > > Can the auto-forms generate an "add" button
> > on the Mammoth auto-form that takes you to a
> > "grok.AddForm" for a Feeding?  Can the auto-form
> > simply generate a hyper-link when displaying the
> > "Feedings" field (grok.Container), so that you can
> > navigate to that object and render a view/template that
> > lists the individual feedings?
> > >
> > > I know all of this is rather basic and wouldn't
> > make for a great user interface, but it would allow you to
> > quickly prototype your content objects.
> > >
> > > I believe the whole "custom widgets" and
> > "multi-adapters" route is probably the right way
> > to do this sort of thing.  But it is a lot for a newbie to
> > get their head around and I haven't seen any simple
> > examples applied in any tutorials.
> > >
> > > Any advice is appreciated.  I will include what I
> > learn in a tutorial that I am writing.  I really just need
> > to be steered in the right direction.
> > >
> > > Thanks,
> > > Steve
> > >
> > >
> > >
> > > _______________________________________________
> > > Grok-dev mailing list
> > > Grok-dev at zope.org
> > > http://mail.zope.org/mailman/listinfo/grok-dev
> > --
> > Timothy Cook, MSc
> > Health Informatics Research & Development Services
> > LinkedIn
> > Profile:http://www.linkedin.com/in/timothywaynecook
> > Skype ID == timothy.cook
> > **************************************************************
> > *You may get my Public GPG key from  popular keyservers or
> >  *
> > *from this link
> > http://timothywayne.cook.googlepages.com/home*
> > **************************************************************
>
>
>
> _______________________________________________
> Grok-dev mailing list
> Grok-dev at zope.org
> http://mail.zope.org/mailman/listinfo/grok-dev
>



-- 
Santiago Videla
www.revolucionesweb.com.ar
http://www.linkedin.com/in/svidela

Sigue la mata dando de que hablar siempre abajo y a la izquierda donde el
pensamiento que se hace corazón resplandece con la palabra sencilla y
humilde que l at s tod at s somos.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.zope.org/pipermail/grok-dev/attachments/20090323/6bc2e6a0/attachment.html 


More information about the Grok-dev mailing list