Hi,<br><div class="gmail_quote"><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br>
Maybe there is some revelation that I have not experienced yet and I am handling this in completely the wrong way.<br>
<br>
If there is a better way to handle hierarchical relationships, please enlighten me.<br>
</blockquote><div><br>I can't tell you too much about auto-forms, but maybe I can help you with the relationships issues.<br><br>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.<br>
<br>I'm using megrok.rdb[1] and it's working very well by now.<br><br>Hope it helps.<br><br>Best Regards <br><br>[1] <a href="http://svn.zope.org/megrok.rdb/">http://svn.zope.org/megrok.rdb/</a> <br><br> </div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>
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.<br>
<br>
Thanks in advance,<br>
<font color="#888888">Steve<br>
</font><div><div></div><div class="h5"><br>
<br>
> Hi Steve,<br>
><br>
> In case you missed it, I think this may help<br>
> <a href="http://grok.zope.org/documentation/tutorial/work-with-forms/using-multiple-schemas-with-a-form" target="_blank">http://grok.zope.org/documentation/tutorial/work-with-forms/using-multiple-schemas-with-a-form</a><br>
><br>
> It is an approach I'll be trying over the next few days<br>
> with a probelm<br>
> that is similar to yours.<br>
><br>
> HTH,<br>
> Tim<br>
><br>
><br>
> On Sat, 2009-03-21 at 21:19 -0700, Steve Schmechel wrote:<br>
> > If you have a "grok.Model based" object that<br>
> contains one or more collections of other "grok.Model<br>
> based" objects, is there are way to quickly represent<br>
> this hierarchy using auto-forms?<br>
> ><br>
> > I cannot find any examples of this nested structure in<br>
> tutorials, how-to's, or example applications. This<br>
> would seem to be a natural layout for many object domains.<br>
> ><br>
> > Is this generally handled differently? Is everything<br>
> handled as "annotations"? Is everything jammed in<br>
> the main application "grok.Container" and then<br>
> located as needed using separate indexes/catalogs?<br>
> ><br>
> > Take, for example, the mammoth example in:<br>
> ><br>
> <a href="http://grok.zope.org/documentation/tutorial/work-with-forms" target="_blank">http://grok.zope.org/documentation/tutorial/work-with-forms</a><br>
> ><br>
> > Mammoth(grok.Model) objects are stored in the<br>
> MammothApplication(grok.Application, grok.Container) and<br>
> auto-forms are used to view, add and edit mammoths.<br>
> ><br>
> > If a caveman wanted to track how much food his mammoth<br>
> was consuming, we might have a collection of<br>
> "feedings" for a given mammoth. Each<br>
> "feeding" object would have attributes/fields for<br>
> the "type of food" and the "weight".<br>
> For simplicity, both attributes could be just user-entered<br>
> text but the feeding should be derived from grok.Model (not<br>
> a list of string pairs or something like that).<br>
> ><br>
> > It appears that zope.schema has a<br>
> "Container" type and a "Dict" type.<br>
> > (grok.Container would map to Dict???)<br>
> > Assuming we just want to be able to record the<br>
> feedings and be able to view a simple listing of feedings<br>
> for a given mammoth, what would be the quickest way to do<br>
> this?<br>
> ><br>
> > Can the auto-forms generate an "add" button<br>
> on the Mammoth auto-form that takes you to a<br>
> "grok.AddForm" for a Feeding? Can the auto-form<br>
> simply generate a hyper-link when displaying the<br>
> "Feedings" field (grok.Container), so that you can<br>
> navigate to that object and render a view/template that<br>
> lists the individual feedings?<br>
> ><br>
> > I know all of this is rather basic and wouldn't<br>
> make for a great user interface, but it would allow you to<br>
> quickly prototype your content objects.<br>
> ><br>
> > I believe the whole "custom widgets" and<br>
> "multi-adapters" route is probably the right way<br>
> to do this sort of thing. But it is a lot for a newbie to<br>
> get their head around and I haven't seen any simple<br>
> examples applied in any tutorials.<br>
> ><br>
> > Any advice is appreciated. I will include what I<br>
> learn in a tutorial that I am writing. I really just need<br>
> to be steered in the right direction.<br>
> ><br>
> > Thanks,<br>
> > Steve<br>
> ><br>
> ><br>
> ><br>
> > _______________________________________________<br>
> > Grok-dev mailing list<br>
> > <a href="mailto:Grok-dev@zope.org">Grok-dev@zope.org</a><br>
> > <a href="http://mail.zope.org/mailman/listinfo/grok-dev" target="_blank">http://mail.zope.org/mailman/listinfo/grok-dev</a><br>
> --<br>
> Timothy Cook, MSc<br>
> Health Informatics Research & Development Services<br>
> LinkedIn<br>
> Profile:<a href="http://www.linkedin.com/in/timothywaynecook" target="_blank">http://www.linkedin.com/in/timothywaynecook</a><br>
> Skype ID == timothy.cook<br>
> **************************************************************<br>
> *You may get my Public GPG key from popular keyservers or<br>
> *<br>
> *from this link<br>
> <a href="http://timothywayne.cook.googlepages.com/home*" target="_blank">http://timothywayne.cook.googlepages.com/home*</a><br>
> **************************************************************<br>
<br>
<br>
<br>
_______________________________________________<br>
Grok-dev mailing list<br>
<a href="mailto:Grok-dev@zope.org">Grok-dev@zope.org</a><br>
<a href="http://mail.zope.org/mailman/listinfo/grok-dev" target="_blank">http://mail.zope.org/mailman/listinfo/grok-dev</a><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>Santiago Videla<br><a href="http://www.revolucionesweb.com.ar">www.revolucionesweb.com.ar</a><br><a href="http://www.linkedin.com/in/svidela">http://www.linkedin.com/in/svidela</a><br>
<br>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@s tod@s somos.<br>