Re: [sqlalchemy] Why is there no SQLA-List class?

2015-08-03 Thread Adam Tauno Williams
Quoting c.bu...@posteo.jp: I know that in most all RDBMS are no implementations of lists or arrays. On the contrary - and emphatically - just about every modern RDMBS supports collection types including lists, sets, multi-sets, and key-value data. This support has been in most databases fo

Re: [sqlalchemy] [SOLVED] HSTORE Column Update [DELETE KEY]

2013-11-18 Thread Adam Tauno Williams
T prefs=delete(user_data.prefs, %(param_1)s) WHERE user_data.prefs ? %(prefs_1)s {'prefs_1': 'inboundBusStop', 'param_1': 'inboundBusStop'} -- Adam Tauno Williams <mailto:awill...@whitemice.org> GPG D95ED383 Systems Administrator, Python Developer,

[sqlalchemy] [SOLVED] HSTORE Column Update

2013-11-18 Thread Adam Tauno Williams
s ? %(prefs_2)s {'prefs_1': {'transitAvaiable': 'true'}, 'prefs_2': 'inboundBusStop'} Which is perfect. Urgh, I cannot wait till PG9.4 & nested HSTORE support. Very cool stuff. -- Adam Tauno Williams <mailto:awill...@whitemice.org> GPG D95

Re: [sqlalchemy] HSTORE Column Update

2013-11-18 Thread Adam Tauno Williams
#x27;, String(12), nullable=False) prefs = Column('prefs', MutableDict.as_mutable(HSTORE)) -- Adam Tauno Williams <mailto:awill...@whitemice.org> GPG D95ED383 Systems Administrator, Python Developer, LPI / NCLA -- You received this message because you are subscribed to the Google Gro

Re: [sqlalchemy] HSTORE Column Update

2013-11-18 Thread Adam Tauno Williams
ot; sqlalchemy.exc.InvalidRequestError: Could not evaluate current criteria in Python. Specify 'fetch' or False for the synchronize_session parameter. -- Adam Tauno Williams <mailto:awill...@whitemice.org> GPG D95ED383 Systems Administrator, Python Developer, LPI / NCLA signature.asc Description: This is a digitally signed message part

[sqlalchemy] PG's JSON Data Type

2013-11-17 Thread Adam Tauno Williams
-- Adam Tauno Williams <mailto:awill...@whitemice.org> GPG D95ED383 Systems Administrator, Python Developer, LPI / NCLA -- You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To unsubscribe from this group and stop receiving emails

[sqlalchemy] HSTORE Column Update

2013-11-17 Thread Adam Tauno Williams
fred'}, }).\ synchronize_session('fetch') The catch is that I need, for the HSTORE type, to update the existing value, not just assign a value to it. -- Adam Tauno Williams <mailto:awill...@whitemice.org> GPG D95ED383 Systems Administrator, Python Developer, LPI / NCLA

Re: [sqlalchemy] Self-Referential scalar query as column_property [SOLVED]

2013-10-03 Thread Adam Tauno Williams
hat I was looking for; otherwise the definition of the model definition [it is a complex model] gets sort of smeared. This works perfectly. -- Adam Tauno Williams <mailto:awill...@whitemice.org> GPG D95ED383 Systems Administrator, Python Developer, LPI / NCLA -- You received this message becau

Re: [sqlalchemy] Self-Referential scalar query as column_property

2013-10-01 Thread Adam Tauno Williams
On Mon, 2013-09-30 at 13:35 -0400, Michael Bayer wrote: > On Sep 30, 2013, at 1:25 PM, Adam Tauno Williams > wrote: > > > I have a table named "project" [class Project] which relates to records > > in table "job" [class Task]. I can add a column_propert

[sqlalchemy] Self-Referential scalar query as column_property

2013-09-30 Thread Adam Tauno Williams
re is something like "extend_existing=True" for adding to a class mapper... but I can't find an example of the syntax that works. -- Adam Tauno Williams <mailto:awill...@whitemice.org> GPG D95ED383 Systems Administrator, Python Developer, LPI / NCLA -- You received this

Re: [sqlalchemy] Can an association_proxy fill in the gaps?

2012-07-31 Thread Adam Tauno Williams
On Mon, 2012-07-30 at 19:56 -0400, Michael Bayer wrote: > On Jul 30, 2012, at 7:47 PM, Adam Tauno Williams wrote: > > I have two classes Contact and CompanyInfo that should exist in a 1:1 > > relation; CompanyInfo contains a comment related to Contact. This works > > -

[sqlalchemy] Can an association_proxy fill in the gaps?

2012-07-30 Thread Adam Tauno Williams
I have two classes Contact and CompanyInfo that should exist in a 1:1 relation; CompanyInfo contains a comment related to Contact. This works - class Contact(Base, KVC): ... _info = relation( 'CompanyInfo', uselist = False, backref = backref( 'co

Re: [sqlalchemy] Re: PostgreSQL hstore custom type?

2012-05-21 Thread Adam Tauno Williams
On Tue, 2012-05-15 at 00:24 -0700, Kyle Schaffrick wrote: > On Mon, Apr 30, 2012 at 8:52 AM, Adam Tauno Williams > Sure, my original version was the attachment > here: http://groups.google.com/group/sqlalchemy/msg/6f7284341ab69164 FYI, for anyone looking for hstore.py in the future I

Re: [sqlalchemy] Best and easy web framwork for sqlalchemy

2012-05-17 Thread Adam Tauno Williams
On Thu, 2012-05-17 at 13:23 +0200, Matteo Boscolo wrote: (1) - Do not hi-jack threads! > I'm looking for a good web framework to show my sqlalchemy information > on the web. > I google and I found several solution like piramid,django, > glashammer,flask but I' do not know exactly witch is the m

Re: [sqlalchemy] Syntax Error on *legitimate* statement using Informix dialect [SOLVED]

2012-05-17 Thread Adam Tauno Williams
On Tue, 2012-05-15 at 20:32 -0400, Adam Tauno Williams wrote: > On Tue, 2012-05-15 at 19:51 -0400, Adam Tauno Williams wrote: > > On Tue, 2012-05-15 at 16:27 -0400, Michael Bayer wrote: > > > Could be tough, you'd need to test it against the informix dbapi > >

Re: [sqlalchemy] Syntax Error on *legitimate* statement using Informix dialect [SOLVED]

2012-05-15 Thread Adam Tauno Williams
On Tue, 2012-05-15 at 19:51 -0400, Adam Tauno Williams wrote: > On Tue, 2012-05-15 at 16:27 -0400, Michael Bayer wrote: > > Could be tough, you'd need to test it against the informix dbapi directly, > using bound parameters, to see what it needs. Could be a typing iss

Re: [sqlalchemy] Syntax Error on *legitimate* statement using Informix dialect

2012-05-15 Thread Adam Tauno Williams
of issue must be addressed in other dialects??? > On May 15, 2012, at 11:36 AM, Adam Tauno Williams > wrote: > > I'm use the Informix dialog with SQLalchemy 0.7.7 (the latest 0.7.x > > release). > > It works. > > But now I'm getting this error - > >

[sqlalchemy] Syntax Error on *legitimate* statement using Informix dialect

2012-05-15 Thread Adam Tauno Williams
I'm use the Informix dialog with SQLalchemy 0.7.7 (the latest 0.7.x release). It works. But now I'm getting this error - sqlalchemy.exc.ProgrammingError: (ProgrammingError) SQLCODE -201 in PREPARE: 42000: Syntax error or access violation 'SELECT xrefr.xr_serial_no AS xrefr_xr_serial_no, xrefr.x

Re: [sqlalchemy] Re: PostgreSQL hstore custom type?

2012-04-30 Thread Adam Tauno Williams
On Sun, 2012-04-15 at 05:32 -0700, Kyle Schaffrick wrote: > Wow, a blast from the past! :) Yes. > Which version of SQLAlchemy does your new version work with? It's > great that you are now able to get rid of the HStoreComparator, that > really makes it easier to use. The version of SQLA I was u

Re: [sqlalchemy] Sequences, Primary Keys, & Relations

2012-02-25 Thread Adam Tauno Williams
On Thu, 2012-02-23 at 14:49 -0500, Adam Tauno Williams wrote: > I have a database where multiple objects use the same sequence to > generate primary keys - > class ProjectInfo(Base, KVC): > __tablename__ = 'project_info' > object_id = Column(&

[sqlalchemy] Sequences, Primary Keys, & Relations

2012-02-23 Thread Adam Tauno Williams
I have a database where multiple objects use the same sequence to generate primary keys - class ProjectInfo(Base, KVC): __tablename__ = 'project_info' object_id = Column("project_info_id", Integer, Sequence('key_generator'),

[sqlalchemy] Clas ... does not have a mapped column named [moving to 0.7.4]

2012-01-06 Thread Adam Tauno Williams
I'm updating my code to work with 0.7.4; and I have a class that is derived from two tables.I'm looking at but I'm not having any luck. When I try to operate on the database the first time it

[sqlalchemy] SQLalchemy, PostgreSQL/tsearch/ts_rank_cd

2011-12-23 Thread Adam Tauno Williams
I'm stumped how to build the following query in SQLalchemy: SELECT title, ts_rank_cd(textsearch, query) AS rank FROM apod, to_tsquery('neutrino|(dark & matter)') query WHERE query @@ textsearch ORDER BY rank DESC LIMIT 10; I can do tsearch operations; but I can't figure out the syntax for this no

[sqlalchemy] PostgreSQL HSTORE Support?

2011-07-26 Thread Adam Tauno Williams
<http://www.mail-archive.com/sqlalchemy@googlegroups.com/msg19441.html> -- Adam Tauno Williams LPIC-1, Novell CLA <http://www.whitemiceconsulting.com> OpenGroupware, Cyrus IMAPd, Postfix, OpenLDAP, Samba -- You received this message because you are subscribed to the Google Groups

Re: [sqlalchemy] extract / PostgreSQL / Birthdays

2010-10-12 Thread Adam Tauno Williams
On Tue, 2010-10-12 at 14:20 -0400, Michael Bayer wrote: > On Oct 12, 2010, at 1:59 PM, Adam Tauno Williams wrote: > > Database: PostgreSQL 8.4.4 > > SQLAlchemy: 0.6 > > I attempting to query the database for contacts with a recent or > > upcoming birthday. > &g

[sqlalchemy] extract / PostgreSQL / Birthdays

2010-10-12 Thread Adam Tauno Williams
Database: PostgreSQL 8.4.4 SQLAlchemy: 0.6 I attempting to query the database for contacts with a recent or upcoming birthday. So -- doy = datetime.today().timetuple().tm_yday floor = doy - 2 if (floor < 1): floor +=365 ceiling = doy + 14 if (ceiling > 365): ceiling -= 365 db.query(Contact).\

Re: [sqlalchemy] Is ORM the right choice for large scale data manipulation?

2010-07-07 Thread Adam Tauno Williams
ion is complex is all the *more* reason to use an ORM - as it automates much of the plumbing and is very well tested. -- Adam Tauno Williams LPIC-1, Novell CLA <http://www.whitemiceconsulting.com> OpenGroupware, Cyrus IMAPd, Postfix, OpenLDAP, Samba -- You received this message because yo

[sqlalchemy] Column X on class Y conflicts with existing column Z

2010-06-24 Thread Adam Tauno Williams
r/lib/python2.6/site-packages/SQLAlchemy-0.6.1-py2.6.egg/sqlalchemy/ext/declarative.py", line 830, in __init__ _as_declarative(cls, classname, cls.__dict__) File "/usr/lib/python2.6/site-packages/SQLAlchemy-0.6.1-py2.6.egg/sqlalchemy/ext/declarative.py", line 806, in _as_declarative (

[sqlalchemy] SET TRANSACTION ISOLATION LEVEL must be called before any query

2010-05-09 Thread Adam Tauno Williams
I have an large SQLalchemy based project that has been working perfectly - until I added a single query which seems to frequently crash with the following error. Is the "SET TRANSACTION ISOLATION LEVEL must be called before any query" error the cause of the problem or possibly being raised by an e

[sqlalchemy] Columns in joined entity [Was: '_TextClause' object has no attribute 'foreign_keys]

2010-02-03 Thread Adam Tauno Williams
FYI: Upgraded to SQLalchemy 0.5.8 A class produces using __table__ instead of __tablename__ provides the field names as in the database, not as mapped in the joined objects (below: x1, x2). [example: I can use x3.job_id but task_id fails.] And trying to set columns in the derived class like: cla

Re: [sqlalchemy] '_TextClause' object has no attribute 'foreign_keys'

2010-02-03 Thread Adam Tauno Williams
On Wed, 2010-02-03 at 10:55 -0500, Michael Bayer wrote: > Adam Tauno Williams wrote: > > x3 = join(x1, x2) > join() here is: > http://www.sqlalchemy.org/docs/reference/sqlalchemy/expressions.html#sqlalchemy.sql.expression.join > it knows nothing about classes "x1" and

[sqlalchemy] '_TextClause' object has no attribute 'foreign_keys'

2010-02-03 Thread Adam Tauno Williams
I'm trying to convert a working non-declarative map of a two-entity table to declarative style, but the join always fails with "'_TextClause' object has no attribute 'foreign_keys'" NON-DECLARATIVE STYLE (WORKING) -- engine = create_engine('postgres:

[sqlalchemy] Getting useful error messages

2010-02-03 Thread Adam Tauno Williams
Attempting, again, to get a declarative representation of a two table entity , but I keep getting errors like: Traceback (most recent call last): File "",

Re: [sqlalchemy] Re: Two Table Entity In Declarative Style [$50!]

2010-01-26 Thread Adam Tauno Williams
On Tue, 2010-01-26 at 07:36 -0500, Adam Tauno Williams wrote: > On Tue, 2009-10-06 at 09:56 -0400, Michael Bayer wrote: > > Adam Tauno Williams wrote: > > > But I have one 1:1 relation in my database that would be much easier to > > > model as just one obje

Re: [sqlalchemy] Re: Two Table Entity In Declarative Style [$50!]

2010-01-26 Thread Adam Tauno Williams
On Tue, 2009-10-06 at 09:56 -0400, Michael Bayer wrote: > Adam Tauno Williams wrote: > > But I have one 1:1 relation in my database that would be much easier to > > model as just one object. > > > > job_history

[sqlalchemy] Two Table Entity In Declarative Style

2009-10-06 Thread Adam Tauno Williams
I'm using SQLAlchemy 0.5.4p2 with Python 2.6.0. So far all of my model has been in the declarative style - class Task(Base): """ An OpenGroupare Task object """ __tablename__ = 'job' object_id = Column("job_id", Sequence('key_generator'