'AutogenContext' object has no attribute '__getitem__'

2015-10-13 Thread Fayaz Yusuf Khan
Hi, Looks like the autogen_context parameter has changed type recently. I'm getting this exception: Traceback (most recent call last): File "/home/fayaz/Programming/weaver-env/bin/weaver", line 9, in load_entry_point('weaver==2.12.1', 'console_scripts', 'weaver')() File

[sqlalchemy] Proper syntax for __table_args__ ?

2015-10-13 Thread Don O'Hara
I'm looking for advice on best SA coding practices to accomplish: 1. Use bind keys 2. Add user-defined tags to tables, to allow iterating through the metadata later to find tables with those tags. 3. Use base table classes for common attributes and methods Is there a chance that class member

Re: [sqlalchemy] Proper syntax for __table_args__ ?

2015-10-13 Thread Mike Bayer
On 10/13/15 7:16 AM, Don O'Hara wrote: > I'm looking for advice on best SA coding practices to accomplish: > > 1. Use bind keys I'm not familiar with that, I see you using something called __bind_key__ and SQLALCHEMY_BINDS. These are not constructs that are part of SQLAlchemy; if this is a

[sqlalchemy] Problem with hybrid_property

2015-10-13 Thread Cecilio Ruiz
Everything works fine, add, modify, etc. But when I ask Caja.Imp. He says he does not exist. # Table definition - Caja # Caja_table = sa.Table("Caja", metadata, sa.Column('id', sa.Integer, nullable=True, autoincrement=True, primary_key=True), sa.Column('Entidad', sa.String,

Re: [sqlalchemy] Proper syntax for __table_args__ ?

2015-10-13 Thread Don O'Hara
Oops - should have asked the Flask-SQLAlchemy folks! Thanks On Tue, Oct 13, 2015 at 11:30 AM, Mike Bayer wrote: > > > On 10/13/15 7:16 AM, Don O'Hara wrote: > > I'm looking for advice on best SA coding practices to accomplish: > > > > 1. Use bind keys > > I'm not

Re: [sqlalchemy] emulating psql's "\copy" function?

2015-10-13 Thread Jon Nelson
On Tue, Oct 13, 2015 at 2:49 PM, Jon Nelson wrote: > On Tue, Oct 13, 2015 at 1:55 PM, Jonathan Vanasco > wrote: >> As part of an archiving routine that uses SqlAlchemy, I need to execute some >> pretty specific commands using `\copy` to archive a

Re: [sqlalchemy] emulating psql's "\copy" function?

2015-10-13 Thread Jon Nelson
On Tue, Oct 13, 2015 at 1:55 PM, Jonathan Vanasco wrote: > As part of an archiving routine that uses SqlAlchemy, I need to execute some > pretty specific commands using `\copy` to archive a selection of columns, in > a special order, into a csv. > > Doing some digging,

[sqlalchemy] emulating psql's "\copy" function?

2015-10-13 Thread Jonathan Vanasco
As part of an archiving routine that uses SqlAlchemy, I need to execute some pretty specific commands using `\copy` to archive a selection of columns, in a special order, into a csv. Doing some digging, psycopg2 provides an interface to `COPY` -- but that doesn't work for my needs. I'd

Re: [sqlalchemy] Problem with hybrid_property

2015-10-13 Thread Cecilio Ruiz
The error message says: : "AttributeError: 'Caja' object has no attribute 'imp' Yes, is typo error en email. The imp attibute is lower case. El martes, 13 de octubre de 2015, 23:01:34 (UTC+2), Simon King escribió: > > return "

Re: [sqlalchemy] Problem with hybrid_property

2015-10-13 Thread Simon King
Do you perhaps have more than one “Caja” class in your application? Try printing out some of the following values: your_instance.__dict__ type(your_instance) type(your_instance).__dict__ sys.modules[type(your_instance).__module__] Can you drop into pdb at the point where the exception occurs

Re: [sqlalchemy] Problem with hybrid_property

2015-10-13 Thread Simon King
> On 13 Oct 2015, at 17:09, Cecilio Ruiz wrote: > > Everything works fine, add, modify, etc. But when I ask Caja.Imp. He says he > does not exist. > > > # Table definition - Caja > # > Caja_table = sa.Table("Caja", metadata, > sa.Column('id', sa.Integer,

[sqlalchemy] Re: history_meta.py: foreign keys in history table, and relationships

2015-10-13 Thread Alex Fraser
On Tuesday, 25 August 2015 11:23:51 UTC+10, Alex Fraser wrote: > > Is there a declarative way to add foreign keys to the history table when > using history_meta.py? In the app I'm making the user can view old versions > of a document, and I want to make sure e.g. the user that created the old >