[sqlalchemy] Re: Problems with inserting data

2010-09-30 Thread phasma
l.type > > its a tuple, lose the ',' > > On Sep 30, 2010, at 6:42 PM, phasma wrote: > > > > > at: > > ol.type = data['type'], > > print type(data['type']) > > > returns str > > > print ol.__dict__ >

[sqlalchemy] Re: Problems with inserting data

2010-09-30 Thread phasma
7;2',), u'has_minibank': (False,), u'has_car_washer': (False,), u'gps_lng': ('2',), u'type': ('office',), u'_class': ('A',), u'has_beauty_salon': (False,)} On Oct 1, 2:19 am, Michael Bayer wrote: > d

[sqlalchemy] Re: Problems with inserting data

2010-09-30 Thread phasma
If add to sqlalchemy/orm/mapper.py at 1699 line this code: if isinstance(value, tuple): value = value[0] Insert works correctly. On Sep 30, 9:31 pm, phasma wrote: > Hi. > > I've got auto

[sqlalchemy] Problems with inserting data

2010-09-30 Thread phasma
Hi. I've got autoloadable table: --- class ObjectList(object): pass t_object_list = sa.Table('object_list', meta.metadata, autoload=True, autoload_with=engine) orm.mapper(ObjectList, t_object_list) --

[sqlalchemy] Re: Fetching last insert id from MySQL.

2010-09-16 Thread phasma
thers wrote: > On 16/09/2010 11:49, phasma wrote: > > > session imported from Meta ? If use Meta.Session.execute it's returns > > RowProxy, which has no lastrowid parameter. > > Try this: > > with meta.Session: >      result = meta.Session.execute("INSERT state

[sqlalchemy] Re: Fetching last insert id from MySQL.

2010-09-16 Thread phasma
id = result.lastrowid > > http://www.sqlalchemy.org/docs/core/connections.html?highlight=result... > > On Sep 15, 2010, at 5:51 PM, phasma wrote: > > > > > Lastrowid return: "Could not locate column in row for column > > 'lastrowid'". I try to use transacti

[sqlalchemy] Re: Fetching last insert id from MySQL.

2010-09-15 Thread phasma
the ResultProxy for those DBAPIs which support it, > so try using that.   Perhaps you're getting "0" because the transaction is > going away, in which case .lastrowid should solve that issue. > > On Sep 15, 2010, at 12:45 PM, phasma wrote: > > > > >

[sqlalchemy] Fetching last insert id from MySQL.

2010-09-15 Thread phasma
I've got database with auto increment column called `id` and INSERT query, whom I need to execute without model declaration in project. meta.Session.execute() returns ResultProxy, but last_inserted_ids() doesn't work with execute() and "SELECT LAST_INSERT_ID()" statement sometimes return 0. Is ther

[sqlalchemy] Re: MySQL encoding

2008-01-11 Thread phasma
On 12 янв, 04:07, jason kirtland <[EMAIL PROTECTED]> wrote: > phasma wrote: > >> What character set is the db-api driver using?  Try: > > >>  >>> engine.connect().connection.character_set_name() > > >> If it's not utf8, you can configure t

[sqlalchemy] Re: MySQL encoding

2008-01-11 Thread phasma
> > What character set is the db-api driver using?  Try: > >  >>> engine.connect().connection.character_set_name() > > If it's not utf8, you can configure the driver by adding 'charset=utf8' > to your database url. I add charset='utf-8' to 'create_engine' function, but before send data(from query

[sqlalchemy] MySQL encoding

2008-01-06 Thread phasma
Hi! I'm using mysql *** 1. row *** Variable_name: character_set_client Value: utf8 *** 2. row *** Variable_name: character_set_connection Value: utf8 *** 3. row

[sqlalchemy] SQLAlchemy and MySQL

2007-12-15 Thread phasma
Hi! I'm trying create table in database, but 'default' option isn't using, when executing 'paster setup-app development.ini' ... __init.py__ from sqlalchemy import * from sqlalchemy.databases.mysql import * from sqlalchemy.ext.assignmapper import assign_mapper from pylo