[sqlalchemy] Re: 'Column' object has no attribute 'tables'

2007-08-03 Thread Paul Colomiets
Dave Harrison wrote: sysMessageTable = Table( 'sysmessage', Column('id', Integer, primary_key=True), Column('timestamp', DateTime, nullable=False, default=datetime.datetime.now()), Column('summary', String(100), nullable=False), Column('message', TEXT()),

[sqlalchemy] Re: Hierachical data

2007-08-03 Thread Marco Mariani
Alexandre CONRAD ha scritto: Maybe this should need some attention to implement in SA some API to handle nodes (insert, move, remove) of herachical trees in SA the Nested Set way. There are several ways to implement schema and rules (and therefore APIs) just by looking at Celko's

[sqlalchemy] Re: Aggregation

2007-08-03 Thread Paul Colomiets
Michael Bayer wrote: Hmmm, do you mean joining relations against a subrelation that uses an aggregate like MAX ? i'd like to see what you have in mind for this. Well, I think I've not explained it correctly. It looks quite like you're saying, but I want that aggregations to be stored

[sqlalchemy] Re: Hierachical data

2007-08-03 Thread Michael Bayer
First of all, for your example here, youre just storing small subtrees of hierarchical data, and youre not trying to query complex set operations over the entire set of nodes. Nested sets is completely disadvantageous in this case for its complexity, its incompatibility with row-based

[sqlalchemy] Re: Hierachical data

2007-08-03 Thread Alexandre CONRAD
Arnar Birgisson wrote: If I understand correctly the OP has a need to store a set of hierarchical Nodes. Only that some node types (video, image) can't have children while others can (group, media_list). Correct, group and media_list will have childen. I'm also going to integrate a playlist

[sqlalchemy] Re: Hierachical data

2007-08-03 Thread Arnar Birgisson
On 8/3/07, Alexandre CONRAD [EMAIL PROTECTED] wrote: The nested looks more efficient. But, things are still a little confused in my head. I need to well put down the pros and cons of each technic for my needs. I was using XML and I'm now switching to a flat database with technics I've never

[sqlalchemy] Re: Hierachical data

2007-08-03 Thread Alexandre CONRAD
Ok, maybe I got influenced by articles about nested sets beeing better, as pointed Mike. Now I got you guys advices, I'll look deeper into adjacency list. I'm glad I've had such feedback on my problem. This defenitly helps, even more when you just don't know from where to start. Also these

[sqlalchemy] Re: Aggregation

2007-08-03 Thread Michael Bayer
On Aug 3, 2007, at 10:57 AM, Paul Colomiets wrote: Michael Bayer wrote: Hmmm, do you mean joining relations against a subrelation that uses an aggregate like MAX ? i'd like to see what you have in mind for this. Well, I think I've not explained it correctly. It looks quite like

[sqlalchemy] Re: Hierachical data

2007-08-03 Thread Arnar Birgisson
On 8/3/07, King Simon-NFHD78 [EMAIL PROTECTED] wrote: I think of adjacency lists and nested sets as more about hierarchies of a single type of object (imagine trying to represent a family tree with a row for each Person). I don't really think they're relevant in this case. If I understand

[sqlalchemy] Re: Hierachical data

2007-08-03 Thread King Simon-NFHD78
Hi, I think this is a pretty good match for Joined Table polymorphic inheritance, as described in the docs http://www.sqlalchemy.org/docs/adv_datamapping.html#advdatamapping_inhe ritance_joined. Your nodes_table would correspond to the employees table, and the 'subclass' tables such as video

[sqlalchemy] Re: confusing populate_existing

2007-08-03 Thread Michael Bayer
your eagerload doesnt stretch into the user attribute of Address. wouldnt it work if you said options(eagerload_all('address', 'user')) ? bascically whatever is in the SQL query, thats what will get refreshed. On Aug 3, 2007, at 1:02 AM, non-alex wrote: Hi! I'm using queries with

[sqlalchemy] Re: right outer join (newbie)

2007-08-03 Thread mc
I don't need the ROJ either, just didn't understand how it knows by itself to make it a LEFT :-) On Aug 2, 6:52 pm, Jonathan Ellis [EMAIL PROTECTED] wrote: There are good reasons to support full outer join. Some are suggested in the comments to that one article. :) I don't miss right joins

[sqlalchemy] Re: Aggregation

2007-08-03 Thread Michael Bayer
On Aug 3, 2007, at 5:57 AM, Paul Colomiets wrote: Hi, Is there some aggregation ability built-in in the SQLAlchemy? I want some simple functions like counting rows and determining the last one. I know it's something simple to implement with Mapper Extensions, but may be there are

[sqlalchemy] Re: Aggregation

2007-08-03 Thread Paul Colomiets
Michael Bayer wrote: we've just added the atomic update thing to 0.4 (note the uppercase Article which produces a column expression): article.comment_count = Article.comment_count + 1 session.flush() That's great! It's quite unconvenient here, but has a lot of good use cases. i wonder