[sqlalchemy] commit happening but, no changes in the database!

2007-04-11 Thread tml
Hi, I have this following code in my Turbogears which implements nested_sets based msgboard. Each post has its own msg board, so instead of locking the msgboard table itself, i lock the parent post's row while editing the msgboard table. msg_parents is the parent table. msg_board is the table wi

[sqlalchemy] Re: how to do many-to-many on the same table?

2007-04-04 Thread tml
On 4/3/07, Sébastien LELONG <[EMAIL PROTECTED]> wrote: > > I dont have any code for this. Isn't that what a many-many relation is > > supposed to do? > many-to-many relation says "Article can have one or more ArticleRelated, and > ArticleRelated can have one or more Article". You just declare the

[sqlalchemy] Re: how to do many-to-many on the same table?

2007-04-03 Thread tml
Hi Seb, thanks for replying. On Apr 3, 12:44 am, Sébastien LELONG <[EMAIL PROTECTED] securities.fr> wrote: > > So, if article 1 is related to article 2.. then there should be two > > rows in the articles_related_articles table like: > > > 1 2 0 > > > 2 1 0 > > Not sure to understand.I can't see w

[sqlalchemy] how to do many-to-many on the same table?

2007-04-02 Thread tml
Hi, I want to make a relation such that.. i have users post some articles.. and can link them as relatd to other articles. I have the Article table like this: articles = Table('articles', metadata, Column('id', Integer, primary_key=True), Column('topic', Unicode(256), nullable=False),

[sqlalchemy] Re: fetchall returns bad list

2007-03-18 Thread tml
sorry.. in the beginning line i meant, I have this code, but the returning "syms" doesn't work for TurboGear's jsonify. Returning "newSyms" works thanks. On Mar 18, 6:10 pm, "tml" <[EMAIL PROTECTED]> wrote: > Hello, > > I have this code,

[sqlalchemy] fetchall returns bad list

2007-03-18 Thread tml
newSyms = [(t.name, t.symbol) for t in syms] print "Y", newSyms, type(newSyms) return newSyms # This works return syms # This wont work. else: return [] The print returns: X [(u'Oxygen&#

[sqlalchemy] Doing a many-to-many join but accessing the contents of that join table

2007-03-17 Thread tml
))) In above way, i have no way to know if the group.users are officers or moderators in a given group. How can i get this info too as part of the user? Should i do this or make seperate tables for group_officers, group_moderator? thanks much. -tml --~--~-~--~~~

[sqlalchemy] Re: table name bind param

2007-03-15 Thread tml
"UPDATE :table_name SET lft=lft + 2 WHERE lft > :insert_node_val and parent_id = :parent_id;" .. so if i had it as %s, i would have to repeat the same name multiple times in % (name, name, name). I'm ok with this, just curious if there is a better

[sqlalchemy] Re: Making msg board

2007-03-15 Thread tml
), Message.c.id==1), order_by=Message.c.lft) > > > which might not work right? > > > can someone suggest a how do to this please? > > > thanks, > > -tml --~--~-~--~~~---~--~~ You received this message because you are subscribed to th

[sqlalchemy] table name bind param

2007-03-15 Thread tml
t = metadata.engine.text("LOCK TABLE :table_name WRITE; ", bindparams=[bindparam('table_name', type=types.String)]) will not work as the generated statement looks like: LOCK TABLE 'my_table_name' WRITE; Is there any other type I can specify which doesn't quote the string for tablename? The tabl

[sqlalchemy] Making msg board

2007-03-15 Thread tml
sage.c.lft) which might not work right? can someone suggest a how do to this please? thanks, -tml --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To post to this group, send