Hi all -

I want to convert a handful of complicated queries into properties,
for simplicity and ease of maintaince.

I currently have a function in my class called 'dependencies':

   def dependencies(self):
      parent = DataRun.CMDS.alias('PARENT')
      return object_session(self).query(Command).select(
         and_(parent.c.target_id == self.target_id),
         from_obj=[
            join(parent, DataRun.DEPS,
               parent.c.target_id == DataRun.DEPS.c.target_id).join(
               DataRun.CMDS, DataRun.DEPS.c.dep ==
DataRun.CMDS.c.name)])


This works correctly.  I'd like to reduce this to an entry in my
mapper() statement.
    mapper(Command, DataRun.CMDS)

Alternately, if that's not possible, I'd like to determine how to get
to the table object for CMDS, DEPS objects (which are just table's)
without using the global DataRun.  Are there variables associated with
mapped classes that I can use to build references to other tables?

Cheers,
--Benn


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

Reply via email to