[sqlalchemy] Postgres:TEXT and Oracle:CLOB

2011-02-17 Thread jo
Hi all, I have this definition of a table. session = Table('session', database.metadata, Column('id', Unicode(40), primary_key=True, nullable=False), Column('data', Text), Column('expiration_time', TIMESTAMP(timezone=False)), ) In the PostgreSQL DB, it

[sqlalchemy] Need Urgent Help -Many to Many Relations

2011-02-17 Thread Abdul Gaffar
Hi all, Can anybody explain how to relate three tables with a single association table. When a delete a row from master table the entries from the child table should be deleted. The tables are. 1). User. - User_id User_name role Group - group_id group_name Project ---

[sqlalchemy] Re: Need Urgent Help -Many to Many Relations

2011-02-17 Thread NiL
http://www.sqlalchemy.org/docs/orm/extensions/associationproxy.html?highlight=association%20proxy#building-complex-views http://stackoverflow.com/questions/2310153/inserting-data-in-many-to-many-relationship-in-sqlalchemy/2310548#2310548 -- You received this message because you are subscribed

Re: [sqlalchemy] Re: Need Urgent Help -Many to Many Relations

2011-02-17 Thread Abdul Gaffar
Thanks NiL, I reffered the links what u hav given, There are two tables stocks, brokers and an association table holdings. Here I need three tables User, Group, Project and a association table for three tables user_group_project kind of thing Thank again for your reply :) On Thu,

[sqlalchemy] Re: Need Urgent Help -Many to Many Relations

2011-02-17 Thread NiL
your use case is unclear, maybe you could be more specific on what you want to achieve -- You received this message because you are subscribed to the Google Groups sqlalchemy group. To post to this group, send email to sqlalchemy@googlegroups.com. To unsubscribe from this group, send email to

Re: [sqlalchemy] Need Urgent Help - SQLAlchemy Relation

2011-02-17 Thread Hector Blanco
Just a wild guess, but have you tried making your association table like: #association table user_group_table = Table('t_user_group', metadata,    Column('user_id', Integer, ForeignKey('t_user.c.user_id',        onupdate=CASCADE, ondelete=CASCADE)),    Column('group_id', Integer,

[sqlalchemy] Re: Need Urgent Help -Many to Many Relations

2011-02-17 Thread nil
http://www.sqlalchemy.org/docs/orm/extensions/associationproxy.html#building-complex-views Can anybody explain how to relate three tables with a single association table. -- You received this message because you are subscribed to the Google Groups sqlalchemy group. To post to this group,

[sqlalchemy] [Postgres] possibly a bug?

2011-02-17 Thread Hayato ARAKI
Hi With sqlalchemy 0.7b1 and postgresql if you define a BigInteger type for a primarykey, the SQL generated for CREATE TABLE is a 'serial' and not a 'bigserial'. (I am generating the sql using pylons) I just started using sqlalchemy and not sure if this is a bug, but thought I should notice you.

Re: [sqlalchemy] [Postgres] possibly a bug?

2011-02-17 Thread Michael Bayer
yes that is a bug, a regression from 0.6 where you'll get BIGSERIAL. ticket # 2065 is added thanks for the report ! On Feb 17, 2011, at 6:35 AM, Hayato ARAKI wrote: Hi With sqlalchemy 0.7b1 and postgresql if you define a BigInteger type for a primarykey, the SQL generated for CREATE

Re: [sqlalchemy] Postgres:TEXT and Oracle:CLOB

2011-02-17 Thread Michael Bayer
SQLAlchemy ResultProxy is set up by the cx_oracle dialect to add the sqlalchemy.dialect.oracle.CLOB type into any result set with a CLOB which intercepts cx_oracle's LOB and converts to a stream. If you are using a SQLAlchemy engine and not the cx_oracle cursor directly you should not be

Re: [sqlalchemy] Premature autoflushing leads to IntegrityError with AssociationProxy and a backref

2011-02-17 Thread Michael Bayer
the stack trace tells all for autoflush situations. Note this is an 0.7 stacktrace, 0.6 is slightly different but the same series of steps: File test.py, line 107, in module group = Group([item1, item2]) File string, line 4, in __init__ File

[sqlalchemy] Re: Premature autoflushing leads to IntegrityError with AssociationProxy and a backref

2011-02-17 Thread Julien Demoor
Great, thanks a lot! On Feb 17, 7:05 pm, Michael Bayer mike...@zzzcomputing.com wrote: the stack trace tells all for autoflush situations.  Note this is an 0.7 stacktrace, 0.6 is slightly different but the same series of steps:   File test.py, line 107, in module     group = Group([item1,

[sqlalchemy] Find whether a synonym points to a foreign key or a relationship

2011-02-17 Thread Hector Blanco
Hello everyone! Let's say I have a class defined like this: class User(declarativeBase): Represents a user __tablename__ = users _id = Column(id, Integer, primary_key=True) _phone = Column(phone, String(16)) _userName = Column(user_name, String(50),

[sqlalchemy] Transactional DDL and SQLite?

2011-02-17 Thread Daniel Holth
Can someone help me understand why DDL seems to not be transactional here: import sqlalchemy e = sqlalchemy.create_engine('sqlite://') c = e.connect() t = c.begin() c.execute(CREATE TABLE foo (bar INTEGER)) t.rollback() assert u'foo' in e.table_names() # True But, if I start up `sqlite3 db.db`

Re: [sqlalchemy] Transactional DDL and SQLite?

2011-02-17 Thread Michael Bayer
On Feb 17, 2011, at 9:48 PM, Daniel Holth wrote: Can someone help me understand why DDL seems to not be transactional here: import sqlalchemy e = sqlalchemy.create_engine('sqlite://') c = e.connect() t = c.begin() c.execute(CREATE TABLE foo (bar INTEGER)) t.rollback() assert u'foo'

Re: [sqlalchemy] Find whether a synonym points to a foreign key or a relationship

2011-02-17 Thread Michael Bayer
On Feb 17, 2011, at 6:37 PM, Hector Blanco wrote: Hello everyone! Let's say I have a class defined like this: class User(declarativeBase): Represents a user __tablename__ = users _id = Column(id, Integer, primary_key=True) _phone = Column(phone, String(16))