Hey,<br><br><div class="gmail_quote">On Thu, Jul 23, 2009 at 3:40 PM, Wyatt Baldwin <span dir="ltr">&lt;<a href="mailto:wyatt.lee.baldwin@gmail.com">wyatt.lee.baldwin@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
I have an existing Web application written in Python that I&#39;m looking to re-implement in a modern Python framework. Now that Grok is approaching 1.0, I am taking another look at it for this purpose, and it&#39;s lookin&#39; good.<br>

<br>My only question (at this point, anyway) is whether there is a way to reuse existing SQLAlchemy-based model classes without having to add any Grok directives and/or Zope-specific integration code to them. The model for my application is in a &quot;core&quot; package that *cannot* be modified to support Grok (or any other Web framework) directly. One idea I have is a function that takes a SA mapped class and returns a Grok model.<br>

<br>I&#39;ve started looking at some of the libraries for integrating SA with Zope/Grok, but I admit that I haven&#39;t looked very deeply as yet. I&#39;ve also been reading the Grok docs and this list but haven&#39;t found a definite answer yet. Is what I want to do already possible? Would it be straightforward to implement something like an `sa_model_wrapper`? Can I create a subclass of a SA model class that uses `grok.Model` as a mixin?</blockquote>
<div><br><br>
You may want to checkout megrok.rdb [1] 
but I&#39;m not sure if it&#39;s what you are looking for.<br><br>Take a look to the doctest of reflection [2], I didn&#39;t try it my self, but it seems that you are able to define Grok models that will be mapped to existing tables.<br>
<br>Best Regards<br><br>
[1] <a href="http://svn.zope.org/megrok.rdb/">http://svn.zope.org/megrok.rdb/</a><br>
[2] <a href="http://svn.zope.org/megrok.rdb/trunk/src/megrok/rdb/tests/reflection.py">http://svn.zope.org/megrok.rdb/trunk/src/megrok/rdb/tests/reflection.py</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>
<br>Any pointers or suggestions would be appreciated, and if RTFM if part of the answer, please give a page number. ;)<br><br><br>[Note: I originally sent this message through the Google Groups UI a few days ago and
nothing happened. Now I&#39;ve subscribed through the mailman UI and am
sending this directly to the list address.]<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></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>