On Mon, Apr 6, 2009 at 3:24 PM, John Hampton [email protected]> wrote:
> Olemis Lang wrote:
>> This is somethin' I'd like to know. Other framews like Django are able
>> to use ORMs in order to abstract the access to the underlying DB(s)
>
> If you're asking whether or not Trac uses an ORM, the answer is no.
>

Yes AFAIK it employs model classes but these classes access the
database directly using SQL ...

> However, there is nothing in Trac preventing you from using your
> favorite ORM to access the Trac tables (provided your favorite ORM can
> properly represent the Trac schema).
>

;)

>> Q: Is there a way to do the same thing in Trac? Otherwise, what's
>> needed to make that happen ?
>
> You need to have some knowledge of whatever ORM you want to use.  You
> need to import it, and create a connection to the database, and then do
> whatever it is you want with it.
>

This is in order to use the ORM. Ok. But my question was actually
about overriding Trac built-in models by using classes generated by
the ORM, perhaps using the same or similar schema ;)

My doubt is mainly about how to connect Trac (plugins, components,
...) with ORM-specific classes, and replace the built-in approach to
access DBs. AFAIK, Trac models contain hard-coded SQL statements,
besides instances of plugins rely on self.get_db_cnx() to access the
database, and not in entity classes (e.g. those provided by ORMs)

-- 
Regards,

Olemis.

Blog ES: http://simelo-es.blogspot.com/
Blog EN: http://simelo-en.blogspot.com/

Featured article:
Se retira el BDFL ... ¿El fin de Python 3k?

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Trac 
Users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/trac-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to