[sqlalchemy] Documenting sqlalchemy objects via sphinx automodule

2012-09-04 Thread Sean Davis
I'm not sure there is a solution to this problem without changes to sphinx, but here is what I've got. In my __init__.py, I have: Session = sessionmaker() Base = declarative_base() def init_model(**kwargs): Initialize the database model mydb = URL(drivername='mysql',

[sqlalchemy] Re: Cannot adapt for insert

2008-10-04 Thread Sean Davis
On Oct 3, 10:58 pm, Sean Davis [EMAIL PROTECTED] wrote: ProgrammingError: (ProgrammingError) can't adapt 'INSERT INTO runbrowser_image (id, nobj, focusmetric, focusuniformity, choffset_x, choffset_y, blu, flu, int_min, int_mean, int_stdev, int_max, int_median, int_q87, nse_min, nse_mean

[sqlalchemy] Cannot adapt for insert

2008-10-03 Thread Sean Davis
ProgrammingError: (ProgrammingError) can't adapt 'INSERT INTO runbrowser_image (id, nobj, focusmetric, focusuniformity, choffset_x, choffset_y, blu, flu, int_min, int_mean, int_stdev, int_max, int_median, int_q87, nse_min, nse_mean, nse_stdev, nse_max, base, tile_id) VALUES (%(id)s, %(nobj)s,

[sqlalchemy] getting all indexes in a metadata instance

2008-09-30 Thread Sean Davis
I am mirroring a database from mysql to postgresql. Mysql allows indexes to have the same names as columns. I would like to find all the indexes and rename them systematically to avoid these name collisions. How can I get the list of indexes and then modify the names before creating the second

[sqlalchemy] Re: getting all indexes in a metadata instance

2008-09-30 Thread Sean Davis
On Sep 30, 11:18 am, Sean Davis [EMAIL PROTECTED] wrote: I am mirroring a database from mysql to postgresql.  Mysql allows indexes to have the same names as columns.  I would like to find all the indexes and rename them systematically to avoid these name collisions.  How can I get the list

[sqlalchemy] Custom type definition and can't adapt 'INSERT INTO.... error

2008-09-27 Thread Sean Davis
I have been playing with new types using sqlalchemy and have an error I do not understand. Table schema and type definition are here: - def generate_uuid(): return uuid.uuid1() class GUID(sa.types.TypeEngine): def __init__(self): pass

[sqlalchemy] Re: Custom type definition and can't adapt 'INSERT INTO.... error

2008-09-27 Thread Sean Davis
On Sep 27, 5:16 pm, Michael Bayer [EMAIL PROTECTED] wrote: On Sep 27, 2008, at 3:12 PM, Sean Davis wrote: I have been playing with new types using sqlalchemy and have an error I do not understand.  Table schema and type definition are here

[sqlalchemy] Re: Column metadata from mapped class

2008-07-22 Thread Sean Davis
On Jul 20, 11:28 am, Michael Bayer [EMAIL PROTECTED] wrote: On Jul 20, 2008, at 7:48 AM, Sean Davis wrote: I have been playing with 0.5 and have a very simple question.  If I have a mapped class, User, how can I get at the columns of User?  I see lots of constructs like User.c

[sqlalchemy] Column metadata from mapped class

2008-07-20 Thread Sean Davis
I have been playing with 0.5 and have a very simple question. If I have a mapped class, User, how can I get at the columns of User? I see lots of constructs like User.c, but User has no 'c' attribute now. I am looking at finding the column types, names (to loop over), etc. Thanks, Sean

[sqlalchemy] Many-to-many back to single table

2007-10-12 Thread Sean Davis
I have two tables: create table a ( id serial primary key, name varchar(255) unique ); create table b ( id serial primary key, subject int references a(id), object int references b(id), otherinfo varchar(255) ); I have been trying to pull ideas together from the self-referential portion of the

[sqlalchemy] Multiple foreign keys to the same table from another table

2007-07-20 Thread Sean Davis
I have a table that has two columns that reference the same table in a foreign-key relationship. What do I need to specify and where to avoid the error below? class 'sqlalchemy.exceptions.ArgumentError': Error determining primary and/or secondary join for relationship 'FeatureLoc.feature

[sqlalchemy] Re: Multiple foreign keys to the same table from another table

2007-07-20 Thread Sean Davis
On Jul 20, 11:57 pm, Sean Davis [EMAIL PROTECTED] wrote: I have a table that has two columns that reference the same table in a foreign-key relationship. What do I need to specify and where to avoid the error below? class 'sqlalchemy.exceptions.ArgumentError': Error determining primary

[sqlalchemy] Re: save_or_update() with a unique but not primary key

2007-03-13 Thread Sean Davis
On Tuesday 13 March 2007 07:35, Sean Davis wrote: We are creating a database that will have a set of autoincrement primary keys on the tables. However, many of the tables also have one or more unique keys associated with them. Can we use save_or_update() (and, by extension, cascade

[sqlalchemy] Re: Is it possible to know the size of a deferred PickleType?

2007-03-06 Thread Sean Davis
On Tuesday 06 March 2007 05:32, Sanjay wrote: Hi All, Wondering if it is possible to know the size of a file stored in a deferred column (PickleType), without retrieving the file itself. I usually try to save the filesize as a separate column. Sean

[sqlalchemy] Tool to autogenerate code from db schema

2007-02-20 Thread Sean Davis
Just a quick question, but is there code available to autogenerate code for SA or Elixir from an existing (rather large) database? I could use SQLSoup directly, but it really helps me to be able to see the generated code. Also, some of the classes will benefit from some added methods. Thanks,

[sqlalchemy] Re: Is there any way to call a python function for primary key generation

2007-02-13 Thread Sean Davis
On 2/13/07, vinjvinj [EMAIL PROTECTED] wrote: I use the mx.UID package to generate all my keys. Is there any way to specify that this function be called to generate the primary key for inserts? Thanks, Could this not be done on the database side (depends on the RDBMS)? Sean

[sqlalchemy] schema comments

2007-02-12 Thread Sean Davis
I looked over the docs but didn't find an answer (so the answer is probably no). Does SA allow descriptions (database comments) of tables and/or columns? Thanks, Sean --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups

[sqlalchemy] Re: Full Text Search using PostgreSQL and tsearch2

2007-01-18 Thread Sean Davis
On Thursday 18 January 2007 07:11, Sanjay wrote: Hi All, Trying to implement full text search with PostgreSQL and tsearch2, being a beginner, I am facing some basic hurdles: 1. How to declare a table in SA, I mean, what SA datatype should tsvector correspond to? 2. Can the index be defined

[sqlalchemy] Re: Full Text Search using PostgreSQL and tsearch2

2007-01-18 Thread Sean Davis
On Thursday 18 January 2007 14:19, Chris Shenton wrote: I'd be interested in how you work this out as I want to do something similar. Would you be willing to write it up and perhaps post it to the wiki? I was able to get MySQL's fulltext search working more quickly than PostgreSQL's and

[sqlalchemy] Accessing DBAPI cursor object from connection

2007-01-18 Thread Sean Davis
I would like to access the underlying psycopg2 connection to get at a DBAPI2 cursor with the ultimate goal of using the copy_from/copy_to protocol for moving large amounts of data to/from the database. I can't seem to find a way to do that from a db engine or connection object. Is there a way

[sqlalchemy] Re: Accessing DBAPI cursor object from connection

2007-01-18 Thread Sean Davis
On Thursday 18 January 2007 17:42, Jonathan Ellis wrote: engine.raw_connection().cursor() Ah, yes! Thanks. Sean On 1/18/07, Sean Davis [EMAIL PROTECTED] wrote: I would like to access the underlying psycopg2 connection to get at a DBAPI2 cursor with the ultimate goal of using

[sqlalchemy] Oracle autoload problem?

2007-01-09 Thread Sean Davis
I am experimenting with autoloading tables from Oracle (9.2) running on a remote machine. Normal selects using cx_Oracle work just fine. Here is what I get: from sqlalchemy import * eng = create_engine('oracle:// ...') md = BoundMetaData(eng) g2r = Table('gene2refseq',md,autoload=True)

[sqlalchemy] Re: Oracle autoload problem?

2007-01-09 Thread Sean Davis
On 1/9/07, Andrija Zarić [EMAIL PROTECTED] wrote: This very strange, because SQLAlchemy is issuing the query like it is supposed to do. There is bind variable (table_name) but for some reason cx_Oracle/Oracle is raising ORA-1008. Can you assert that following is working: import cx_Oracle

[sqlalchemy] Lazy load a single column

2007-01-05 Thread Sean Davis
A simple question: I have a table with one HUGE column. Is there a way to make this column lazy-loaded? Thanks, Sean --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups sqlalchemy group. To post to this group, send

[sqlalchemy] Re: Lazy load a single column

2007-01-05 Thread Sean Davis
On 1/5/07, Lee McFadden [EMAIL PROTECTED] wrote: On 1/5/07, Sean Davis [EMAIL PROTECTED] wrote: A simple question: I have a table with one HUGE column. Is there a way to make this column lazy-loaded? http://www.sqlalchemy.org/docs/adv_datamapping.myt#advdatamapping_properties_deferred

[sqlalchemy] SqlSoup error

2006-12-22 Thread Sean Davis
I have the following three tables and trying to do a join. See below for details: g_main ( gene_id serial primary key, . ); g_refseq ( refseq varchar references refseq(refseq), gene_id int references g_main(gene_id) ); refseq ( refseq varchar primary key ); from

[sqlalchemy] Re: SqlSoup error

2006-12-22 Thread Sean Davis
On Friday 22 December 2006 10:10, Alan Franzoni wrote: Any suggestions on what I am missing? I don't use sqlsoup and I don't know whether you not using it correctly; btw, if you're in hurry, as a simple workaround, I suggest you add this line to sqlsoup.py, line 369, just above klass_query

[sqlalchemy] Re: Misunderstanding something with autoloading

2006-12-19 Thread Sean Davis
On Tuesday 19 December 2006 05:51, Alan Franzoni wrote: from sqlalchemy import * db = create_engine('postgres://user:[EMAIL PROTECTED]/test5') metadata = BoundMetaData(db) tb = Table('gffdata',metadata,autoload=True) This works fine on my system (ubuntu edgy, x86, python 2.5,

[sqlalchemy] Misunderstanding something with autoloading

2006-12-18 Thread Sean Davis
I have a simple test case given here: from sqlalchemy import * db = create_engine('postgres://user:[EMAIL PROTECTED]/test5') metadata = BoundMetaData(db) tb = Table('gffdata',metadata,autoload=True) Up to this point, I think this looks like what is in the tutorial. However, I get the