[sqlalchemy] How to query with aggregate function?

2009-01-13 Thread Chen Houwu
I am not very familiar with SqlAlchemy, now I have a problem to query with aggregate function. Here is the class -- class Directory(DeclarativeBase): An ultra-simple group definition. __tablename__ = 'docman_directory' dir_id = Column(Integer,

[sqlalchemy] How to query with aggregate function?

2009-01-12 Thread Chen Houwu
I am not very familiar with SA, now I have a problem to query with aggregate function. Here is the class -- class Directory(DeclarativeBase): An ultra-simple group definition. __tablename__ = 'docman_directory' dir_id = Column(Integer, autoincrement=True,

[sqlalchemy] Re: Problem about connecting to postgres

2008-12-30 Thread Chen Houwu
I have got it. The connect string should be sqlalchemy.url=postgres:// chw:c...@127.0.0.1:5432/docman the quickstart generated develepment.ini has wrong configed postgres On 12月30日, 下午3时53分, Chen Houwu chenho...@gmail.com wrote: I am new to postgres and TG2. I can connect the a postgres

[sqlalchemy] Re: How can I know the state of an instances?

2008-12-29 Thread Chen Houwu
something else alternatively, you can explicitly say elif instance in session.new: On Dec 27, 2008, at 4:35 AM, Chen Houwu wrote: I want to do as following: if instance is Transient: do something else instance is Pending: do something else How can I accomplish

[sqlalchemy] Problem about connecting to postgres

2008-12-29 Thread Chen Houwu
I am new to postgres and TG2. I can connect the a postgres database using pgAdminIII with the acount: usernam:chw password:chw Here is the connect string in develepment.ini: sqlalchemy.url=postgres://chw:chw:5...@127.0.0.1/docman but when I run paster setup-app develepment.ini, I got the

[sqlalchemy] How can I know the state of an instances?

2008-12-27 Thread Chen Houwu
I want to do as following: if instance is Transient: do something else instance is Pending: do something else How can I accomplish it? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups sqlalchemy group. To post

[sqlalchemy] Re: How to deal with non-ASCII(such as Chinese)table name?

2007-03-27 Thread Chen Houwu
Bayer [EMAIL PROTECTED] wrote: non-ascii attribute names in your Python code ? or non-ascii column names defined in your database table ? I didnt know the latter was possible with most databases. On Mar 25, 2007, at 1:04 AM, Chen Houwu wrote: from the sqlalchemy documentation, I found

[sqlalchemy] Re: How to deal with non-ASCII(such as Chinese)table name?

2007-03-27 Thread Chen Houwu
: then there is currently no fix for your situation until this feature is added to SA. On Mar 27, 2007, at 7:27 AM, Chen Houwu wrote: I mean non-ascii column names defined in my database table. SqlServer, Oracle, MySql...all of the mainstream DBMS support this feature, In east asia(China

[sqlalchemy] Re: How to deal with non-ASCII(such as Chinese)table name?

2007-03-27 Thread Chen Houwu
within the properties by stating the key/column combinations explicitly: user_mapper = mapper(User, users_table, properties={ 'id' : users_table.c.user_id, 'name' : users_table.c.user_name, }) --- On 3月27日, 下午10时55分, Chen Houwu [EMAIL PROTECTED] wrote: But following

[sqlalchemy] How to deal with non-ASCII(such as Chinese)table name?

2007-03-24 Thread Chen Houwu
from the sqlalchemy documentation, I found when table definition (e.g users_table = Table('users', metadata, ... Column('user_id', Integer, primary_key=True), ... Column('user_name', String(40)), ... Column('password', String(10)) ... ) ) and a class (e.g. class User(object): ...