these are really interesting. im not sure if I can give you advice
on them since Im not totally sure what they do....they both seem to
have some overlap with what the mapper/relations do, like if you save
an object with the mapper, it will insert or update as appropriate,
and if nothing has changed it wont update anything. im not sure if
"add_assoc" was to work around the inheritance issue you had but the
goal is that you wouldnt have to hack anything too badly to work out
pretty much any kind of relationship.
the find_fk_column/add_assoc is trying to match up tables ?
find_fk_column could be done like:
def find_fk_column(table, parent_table):
return [c for c in parent_table.columns if c.foreign_key and
c.foreign_key.references(table)]
to get a full "join" clause, the Join object will do it too, which
will account for foreign keys in either direction:
join(table1, table2).onclause
it will also find the correct "join" clause between Alias objects as
well.
On Feb 25, 2006, at 6:55 PM, Florian Boesch wrote:
Hi, I'm fairly new to sqlalchemy and I noticed that I've written
some utility
functions which I seek advice upon (acting on the assumption that
they're
fairly silly and somebody must just enlighten my ways :D).
Thanks for having a look at the atachment,
Florian
<snipplets.py>
-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
Sqlalchemy-users mailing list
Sqlalchemy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sqlalchemy-users