[sqlalchemy] SQLAlchemy. Creating tables that share enum

2016-08-22 Thread Fran Goitia
Models FacebookPost and TwitterPost share an enum called types. This enum is correctly created when creating facebook_posts table, but when trying to create twitter_posts table, there is an attempt to recreate this type which results in an error. sqlalchemy.exc.ProgrammingError:

[sqlalchemy] Using Python functions in query with automap reflected tables?

2016-08-22 Thread Rahul Ahuja
I'm having some trouble using Python string functions on VARCHAR columns in MySQL (reflected using automap_base() and base.prepare). I'm getting AttributeError: Neither 'InstrumentedAttribute' object nor 'Comparator' object associated with users.middlename has an attribute 'replace' when I

Re: [sqlalchemy] What criteria should I use to determine whether I need a distinct class-level expression for my hybrid attributes?

2016-08-22 Thread Mike Bayer
On 08/22/2016 03:20 AM, Jinghui Niu wrote: I'm creating a mixin for my timestamp columns throughout my projects. Internally, the mixin uses UTC strings to store timestamps, externally it converts back and forth into local time using a second column that stores timezone information. I'm

Re: [sqlalchemy] Having SA generate constructor when using autoload.

2016-08-22 Thread Simon King
On Mon, Aug 22, 2016 at 10:12 AM, Piotr Dobrogost wrote: > I'd like to map a class onto table and automatically get __init__() method > per >

Re: [sqlalchemy] Google Bigquery support

2016-08-22 Thread rlanda
Thanks! Will do. All the best Raul On Friday, August 19, 2016 at 3:14:00 PM UTC+1, Mike Bayer wrote: > > > > On 08/19/2016 06:37 AM, rla...@fastly.com wrote: > > Hello all, > > > > I have implemented the first stab at a PEP 249 adaptor layer for > > BigQuery and it seems to work well. It is

[sqlalchemy] Having SA generate constructor when using autoload.

2016-08-22 Thread Piotr Dobrogost
I'd like to map a class onto table and automatically get __init__() method per http://docs.sqlalchemy.org/en/rel_1_0/orm/extensions/declarative/api.html#sqlalchemy.ext.declarative.declarative_base.params.constructor However when I declare class as Base = declarative_base(metadata=metadata)

[sqlalchemy] What criteria should I use to determine whether I need a distinct class-level expression for my hybrid attributes?

2016-08-22 Thread Jinghui Niu
I'm creating a mixin for my timestamp columns throughout my projects. Internally, the mixin uses UTC strings to store timestamps, externally it converts back and forth into local time using a second column that stores timezone information. I'm studying the hybrid attribute section in the