Hi from the Jeroen guy ;)

As you can see my version of mixing sqlalchemy and django is a bit
dormant. At the very least it needs some changes to work with
sqlalchemy .4. Besides my code is a bit sloppy, as much of the
translation django syntax -> sqlalchemy syntax was trial and error.

What my solution basically does is translate the django mapping to
sqlalchemy mapping, give the django model an inner class which will
then be the sqlalchemy model. 
http://jeroen.concept-q.com/projects/djangoalchemy/readme.txt
explains it nicely.

For now this isn't too exiting, however, it means you have only one
set of model to maintain, all the relations and custom names of fields
will be the same in the sqlalchemy model. Moreover, it should be
possible to use custom methods from the django model in the sqlalchemy
model. It is my guess that with little effort it should be possible to
emit the signals django models send as well..

One thing that does not work yet are generic relations. Those seem
pretty django specific.

One more advanced thing i would REALLY love to see is some form of
lazy object initialisation. Both the django and sqlalchemy ORM
immediately create an object, while often the basic dictionary of rows
would suffice (when you query for the last 10 posts, you really don't
need the post object, only the rows with post id, title, and time.
Only when you start manipulating a single post, you need the object to
call, for example, the save method. It seems to me that once an
unknown method is being called, it is a nice time to "upgrade" the
simple dictionary to a full blown object with save method..) However,
i'm a bit clueless how to implement this ;)

Anyway, good luck with the django + sqlalchemy solution. "Steal" as
many ideas you want. The development of my thingy will probably go
slow, as the main reason for publishing such an alpha status solution
was to get others to think on getting sqlalchemy to work inside
django. (Sadly (or fortunately as it means the django ORM _is_
sufficient for all) there seems not much interest in blending
sqlalchemy in django, so don't expect lots of (external) need for your
project)


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to django-developers@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to