Hi Martijn<br><br>I&#39;m trying your last updates on this, nice work. :)<br><br>I can&#39;t figured out how to use it to develop some real app. With &quot;real&quot; I mean, bigger for example. And with bigger I mean, different modules or packages that defines the models (rdb.Models) and the grokApp will make use of them<br>
<br>I was thinking to have something like:<br><br>myProject.clients/<br>&nbsp;&nbsp;&nbsp;&nbsp; myProject/<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; clients/<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; models.py&nbsp; ###&nbsp; Clients models (rdb.Model)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ....<br>src/<br>&nbsp;&nbsp;&nbsp;&nbsp; ProjectExmple/<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; app.py ### use Client models<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ....<br><br>is this possible? hints? <br><br>maybe I&#39;m wrong, and this is not the best way to organize my project, advices are welcome :P<br><br>Regards<br><br><div class="gmail_quote">
On Wed, Jun 25, 2008 at 9:46 AM, Martijn Faassen &lt;<a href="mailto:faassen@startifact.com">faassen@startifact.com</a>&gt; wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi there,<br>
<br>
I&#39;ve started updating megrok.rdb, using the recent work done on zope.sqlalchemy, z3c.saconfig, and my now somewhat greater understanding of SQLAlchemy.<br>
<br>
As a result, megrok.rdb has moved to a top-level directory in svn and now actually has a README.txt which is also a doctest:<br>
<br>
<a href="http://svn.zope.org/megrok.rdb/trunk/src/megrok/rdb/README.txt" target="_blank">http://svn.zope.org/megrok.rdb/trunk/src/megrok/rdb/README.txt</a><br>
<br>
I also updated the rdbexample to make use of the new code, though it&#39;s rather hard to play with it as it has the horrible text-only screens instead of proper page templates:<br>
<br>
<a href="http://svn.zope.org/grokapps/rdbexample/trunk" target="_blank">http://svn.zope.org/grokapps/rdbexample/trunk</a><br>
<br>
There is a lot that remains to be done.<br>
<br>
* The directives need to become a lot stricter; right now it&#39;s too easy to do something wrong and get an obscure error. We need more validation, better default behavior, etc.<br>
<br>
* It turns out that using auto-generated primary keys as a container key doesn&#39;t look possible: this primary key is not assigned yet by the database by the time the container can be used. This means containers need an important re-think as this destroys the only sensible default behavior I can think of right now. This is a big problem and we need some way around it - there often is no other column in a database table that can function as a key.<br>

<br>
* it would be nice if we could have a default behavior for metadata, so that the rdb.metadata directive can be omitted entirely. Note that the rdb.metadata directive may not work properly yet on a module level; at least I haven&#39;t tested it yet.<br>

<br>
* More work needs to be done in making database setup easier. While z3c.saconfig helps a lot, it&#39;s still setting up quite a bit to get the basic case working. I hope we&#39;ll eventually see a grokui.rdb which allows people to set up a database utility and connection parameters through the grok admin screens.<br>

<br>
* actually automatically creating the tables in the database from the metadata is something we need some infrastructure for too. Right now in rdbexample I do this upon first traversal into the application. We could do it upon application add time perhaps, and also perhaps present a UI in grokui.rdb to let people refresh the database tables.<br>

<br>
* I haven&#39;t even touched the part that generates a Zope 3 schema from database schemas; this code is nice to generate forms. This requires some more study of the various alternatives around, and SQLAlchemy itself (last time we looked at it we weren&#39;t able to retrieve the order of definition for columns in a table, which is rather important to show a nice form).<br>

<br>
Regards,<br>
<br>
Martijn<br>
<br>
_______________________________________________<br>
Grok-dev mailing list<br>
<a href="mailto:Grok-dev@zope.org" target="_blank">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>
</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.