[sqlalchemy] How can I built two different ForeignKey relation refer to a same model.

2009-08-19 Thread Alisue
t article.intermediate_company = intermediate session.add(article) session.commit() And The Error message was: Traceback (most recent call last): File "/Users/alisue/Documents/workspaces/aptana/selling.iyeiye/ sellingiyeiye/tests/model/articles/test_article.py", line 29, in tearDown

[sqlalchemy] Re: How can I built two different ForeignKey relation refer to a same model.

2009-08-19 Thread Alisue
OOps. Doesn't matter. It's all my fault. I used Unittest and I delete management_company on tearDown. (duaring management_company_id set nullable=False) I set 'cascade="all"' and everything goes Correct. Sorry. On 8月20日, 午前11:41, Alisue wrote: > Article has

[sqlalchemy] Re: How can I use count with group_by with webhelpers.paginate

2009-06-23 Thread Alisue
Thanks! That is the what i want. On 6月22日, 午後11:40, "Michael Bayer" wrote: > Alisue wrote: > > > Oops. I found the solution with my self. > > > like below. > > > c.paginator = paginate.Page( > > meta.Session.query(Article).selec

[sqlalchemy] Re: How can I use count with group_by with webhelpers.paginate

2009-06-22 Thread Alisue
why can't I do like below? or similar way? query.select_from(query.subquery()) On 6月22日, 午後6:34, Alisue wrote: > I have a Article table may relate with a Room table and I want to find > Article sometime with Room.name. > So I wrote the code like below. > > query = meta.Session.

[sqlalchemy] How can I use count with group_by with webhelpers.paginate

2009-06-22 Thread Alisue
I have a Article table may relate with a Room table and I want to find Article sometime with Room.name. So I wrote the code like below. query = meta.Session.query(Article) query = query.outerjoin('rooms') if room_name is not None: query = query.filter(Room.name == room_name) query = query.gro

[sqlalchemy] Re: Is this SQLAlchemy's bug? The result come differently from session's query and plain sql which built by session's query.

2009-03-16 Thread Alisue
date multiple rows with the same primary key into a > single object instance - comparing the rows returned by the two different > approaches will reveal the source of the issue. set echo='debug' to see > that output. > > Alisue wrote: > > > SQLAlchemy: 0.5.2 > >

[sqlalchemy] Re: Is this SQLAlchemy's bug? The result come differently from session's query and plain sql which built by session's query.

2009-03-16 Thread Alisue
sue. set echo='debug' to see > that output. > > Alisue wrote: > > > SQLAlchemy: 0.5.2 > > SQLite: 3.5.9 > > MySQL: 5.0.67-0ubuntu6 > > > To short. The problem is 'The result come differently from session's > > query and plain sql which

[sqlalchemy] Re: Is this SQLAlchemy's bug? The result come differently from session's query and plain sql which built by session's query.

2009-03-16 Thread Alisue
3\x81\xae \xe5\x89\x8d\xef\xbc\x81', 0, 1, 'over 5LDK', '10*9*8', 6L, 1.5, 1.0, 0.5, 3000L, 800L, 12000L, 1L, 6L, datetime.datetime(2009, 3, 17, 11, 20, 16), None) 11:25:02,299 DEBUG [sqlalchemy.engine.base.Engine.0x...48ec.__init__] Row (70L, '2110\xe5\x8f\xb7\xe5\x

[sqlalchemy] Is this SQLAlchemy's bug? The result come differently from session's query and plain sql which built by session's query.

2009-03-16 Thread Alisue
SQLAlchemy: 0.5.2 SQLite: 3.5.9 MySQL: 5.0.67-0ubuntu6 To short. The problem is 'The result come differently from session's query and plain sql which built by session's query.' Well... It is too difficult to explain the situation so just have a look my code first please. subquery = query.subque