[sqlalchemy] advanced mapping help

2007-06-23 Thread Matt
Hi, I have a relation I'm mapping through an intermediate table and it seems to work fine, it looks something like: Content - ContentCollection - Content 'collection_children':relation(Content, secondary = content_collection,

[sqlalchemy] SQLAlchemy Quick Reference Guide

2007-06-23 Thread Gerald Kaszuba
Hi I've made a quick reference guide (cheat sheet) for SQLAlchemy for myself and I thought I'd release it for every one: http://misc.slowchop.com/misc/wiki/SQLAlchemyCheatSheet There's also a PDF version: http://misc.slowchop.com/misc/wiki/SQLAlchemyCheatSheet?format=pdf Feel free to send me

[sqlalchemy] Re: advanced mapping help

2007-06-23 Thread sdobrev
u may need an explicit intermediate association object, see the docs about many to many relations. Instead of directly getting the children, u'll get the associations via which u can get the children, or whatever attributes of the link. Then if u want a direct children-list, u can make some

[sqlalchemy] Re: Qualified column names in JOINs?

2007-06-23 Thread Christoph Haas
On Fri, Jun 22, 2007 at 08:30:07PM -, Michael Bayer wrote: the contents of the columns clause is configurable via the select() construct directly: result=select([records_a, records_ptr], records_a.c.type=='A', from_obj=[model.outerjoin(records_a, records_ptr, (

[sqlalchemy] Re: Bug in selection from many-to-many relationship?

2007-06-23 Thread Hong Yuan
On 6月23日, 上午12时45分, Michael Bayer [EMAIL PROTECTED] wrote: its correct. the LEFT OUTER JOINs above are the result of the lazy=False eager load you have switched on...if you set lazy=True, you will see the actual statement you are creating via your Query. Because the OUTER JOIN tables are

[sqlalchemy] Re: Qualified column names in JOINs?

2007-06-23 Thread Michael Bayer
im not sure if full outer join is really available on most databases. On Jun 23, 5:12 am, Christoph Haas [EMAIL PROTECTED] wrote: On Fri, Jun 22, 2007 at 08:30:07PM -, Michael Bayer wrote: the contents of the columns clause is configurable via the select() construct directly:

[sqlalchemy] Re: Qualified column names in JOINs?

2007-06-23 Thread Eric Ongerth
On Jun 23, 6:18 am, Michael Bayer [EMAIL PROTECTED] wrote: im not sure if full outer join is really available on most databases. I'm confused by the inclusion of the word really there. Is it that some of them claim to support a full outer join but what they deliver is not really the right

[sqlalchemy] SQLite Regexp

2007-06-23 Thread Simon Roadkill
Hello, My application needs to run against Oracle and SQLite. I'd like to have a query that uses a regexp in a select statement. For Oracle this is fine, as it supports regular expressions natively. For raw SQLite I can do: connection.create_function(regexp, 2, regexp) where regexp is

[sqlalchemy] Re: advanced mapping help

2007-06-23 Thread Matt
Thanks I think I had tried something like this before... Anyway, now I'm defining the relation from Content to ContentCollection and separately from ContentCollection back to Content, but I'm running into the chicken and the egg problem... The mapper expects a class, but I can't define Content

[sqlalchemy] problem with PassiveDefault doc?

2007-06-23 Thread Todd Martin
Hi. I'm using SQLAlchemy with Turbogears and I'm having trouble with the example in the SA doc, though I can get other things to work. Here's the doc link. http://www.sqlalchemy.org/docs/metadata.html#metadata_defaults_passive The code in question is Column('mycolumn', DateTime,

[sqlalchemy] Re: advanced mapping help

2007-06-23 Thread Michael Bayer
On Jun 23, 2007, at 2:50 PM, Matt wrote: Thanks I think I had tried something like this before... Anyway, now I'm defining the relation from Content to ContentCollection and separately from ContentCollection back to Content, but I'm running into the chicken and the egg problem... The

[sqlalchemy] Re: SQLite Regexp

2007-06-23 Thread Michael Bayer
On Jun 23, 2007, at 2:51 PM, Simon Roadkill wrote: Hello, My application needs to run against Oracle and SQLite. I'd like to have a query that uses a regexp in a select statement. For Oracle this is fine, as it supports regular expressions natively. For raw SQLite I can do:

[sqlalchemy] Re: problem with PassiveDefault doc?

2007-06-23 Thread Michael Bayer
On Jun 23, 2007, at 5:53 PM, Todd Martin wrote: Hi. I'm using SQLAlchemy with Turbogears and I'm having trouble with the example in the SA doc, though I can get other things to work. Here's the doc link. http://www.sqlalchemy.org/docs/metadata.html#metadata_defaults_passive The code in