[sqlalchemy] get_col_spec behavior has changed from 0.5.8 to 0.6.X

2010-08-13 Thread robert rottermann
hi there, up to now I did use something like: c = tblCompany.__table__.columns COMPANY_FIELDS = [(k, c[k].type.get_col_spec()) for k in c.keys() if not k=='id'] to build some dynamic forms for a web application. now this breaks with an error: AttributeError: 'VARCHAR' object has no

[sqlalchemy] Custom type does not seem to honour is_mutable

2010-08-13 Thread Dan
I have created a custom type in order to store denormalized PKs in a TEXT field. The idea is that the text is converted back and forth from a set of integers: http://paste.pocoo.org/show/249784/ This seems to work OK, however if you make a change to the set it's not picked up by SQLAlchemy on

[sqlalchemy] MySQL INSERT ... ON DUPLICATE KEY UPDATE

2010-08-13 Thread brian
http://github.com/bedwards/sqlalchemy_mysql_ext -- You received this message because you are subscribed to the Google Groups sqlalchemy group. To post to this group, send email to sqlalch...@googlegroups.com. To unsubscribe from this group, send email to

Re: [sqlalchemy] get_col_spec behavior has changed from 0.5.8 to 0.6.X

2010-08-13 Thread Michael Bayer
On Aug 13, 2010, at 8:19 AM, robert rottermann wrote: hi there, up to now I did use something like: c = tblCompany.__table__.columns COMPANY_FIELDS = [(k, c[k].type.get_col_spec()) for k in c.keys() if not k=='id'] to build some dynamic forms for a web application. now this breaks

Re: [sqlalchemy] Custom type does not seem to honour is_mutable

2010-08-13 Thread Michael Bayer
On Aug 13, 2010, at 10:01 AM, Dan wrote: I have created a custom type in order to store denormalized PKs in a TEXT field. The idea is that the text is converted back and forth from a set of integers: http://paste.pocoo.org/show/249784/ this is unrelated, but the code is incorrect there,

[sqlalchemy] Re: Custom type does not seem to honour is_mutable

2010-08-13 Thread Dan
On Aug 13, 3:17 pm, Michael Bayer mike...@zzzcomputing.com wrote: On Aug 13, 2010, at 10:01 AM, Dan wrote: I have created a custom type in order to store denormalized PKs in a TEXT field. The idea is that the text is converted back and forth from a set of integers:

Re: [sqlalchemy] MySQL INSERT ... ON DUPLICATE KEY UPDATE

2010-08-13 Thread Michael Bayer
nice job. I didn't think MySQL supported RETURNING ? that can all go away if so. Also how do i specify an UPDATE clause distinct from the INSERT ? The mysql docs seem to indicate this is possible (i.e. it would UPDATE c=c+1 instead of inserting 5 columns). Generative would be nice:

Re: [sqlalchemy] Re: Custom type does not seem to honour is_mutable

2010-08-13 Thread Michael Bayer
On Aug 13, 2010, at 10:24 AM, Dan wrote: On Aug 13, 3:17 pm, Michael Bayer mike...@zzzcomputing.com wrote: On Aug 13, 2010, at 10:01 AM, Dan wrote: I have created a custom type in order to store denormalized PKs in a TEXT field. The idea is that the text is converted back and forth

[sqlalchemy] Re: Custom type does not seem to honour is_mutable

2010-08-13 Thread Dan
Unfortunately still getting the same result: http://paste.pocoo.org/show/249801/ The test snippet shows that the modified set is not actually saved to the database. On Aug 13, 3:29 pm, Michael Bayer mike...@zzzcomputing.com wrote: On Aug 13, 2010, at 10:24 AM, Dan wrote: On Aug 13, 3:17

Re: [sqlalchemy] Re: Custom type does not seem to honour is_mutable

2010-08-13 Thread Michael Bayer
On Aug 13, 2010, at 10:45 AM, Dan wrote: Unfortunately still getting the same result: http://paste.pocoo.org/show/249801/ The test snippet shows that the modified set is not actually saved to the database. that code snippet is not complete (doesn't create a Session, doesn't add Post to

[sqlalchemy] Re: Custom type does not seem to honour is_mutable

2010-08-13 Thread Dan
that code snippet is not complete (doesn't create a Session, doesn't add Post to it, doesn't commit() or flush() the session but then removes it so I guess maybe its a scoped_session, don't know) so I don't actually know what you're doing.   The test case below adds your assertion, uses

[sqlalchemy] Re: Custom type does not seem to honour is_mutable

2010-08-13 Thread Dan
The issue appeared to be removing the session instance (session.remove()) - I was trying to get a clean session for testing. Anyway, works fine now - thanks for your help and sorry for wasting your time. On Aug 13, 4:21 pm, Dan danjac...@gmail.com wrote: that code snippet is not complete

Re: [sqlalchemy] Re: Custom type does not seem to honour is_mutable

2010-08-13 Thread Michael Bayer
hey no problem glad you're back in business. On Aug 13, 2010, at 11:35 AM, Dan wrote: The issue appeared to be removing the session instance (session.remove()) - I was trying to get a clean session for testing. Anyway, works fine now - thanks for your help and sorry for wasting your time.

[sqlalchemy] Re: How to link one table to itself?

2010-08-13 Thread Alvaro Reinoso
I've tried many things and I always get similar errors. I'm sure all the foreign keys are OK. Could not determine relationship direction for primaryjoin condition 'users.id = user_channels.user_id', on relationship User.channels. Do the columns in 'foreign_keys' represent only the 'foreign'

Re: [sqlalchemy] How to link one table to itself?

2010-08-13 Thread Michael Bayer
On Aug 12, 2010, at 1:08 PM, Alvaro Reinoso wrote: Hello, I'm trying to link one table to itself. I have media groups which can contain more media group. I created a relation many to many: media_group_groups = Table( media_group_groups,

[sqlalchemy] Re: SQLite: Rolling back DDL requests

2010-08-13 Thread Peter Hansen
On Jun 24, 1:23 pm, Michael Bayer mike...@zzzcomputing.com wrote: On Jun 24, 2010, at 12:35 PM, Torsten Landschoff wrote: That's what I thought but it does not cure my problem. e.raw_connect().isolation_levelis in fact None, but the rollback is not done anyway. :-( its passing it