[sqlalchemy] Re: Mapping with eagerload from arbitrary ResultSet?

2006-10-18 Thread Michael Bayer
since i was working on this anyway, i added a feature that will make this possible, although i want to improve upon it. what you can do right now is: class User(object):pass class Address(object):pass mapper(User, user_table, properties={ 'addresses':relation(Address, lazy=False) }) map

[sqlalchemy] Re: ActiveMapper, version_id_col

2006-10-18 Thread Michael Bayer
great !! for a versioning unittest example, take a look at test/orm/ unitofwork.py, class VersioningTest. you can probably copy that class into the activemapper test suite with just a few changes. On Oct 19, 2006, at 2:06 AM, Simon Wittber wrote: > > On Oct 19, 3:17 am, Jonathan LaCour <[EM

[sqlalchemy] Re: ActiveMapper, version_id_col

2006-10-18 Thread Simon Wittber
On Oct 19, 3:17 am, Jonathan LaCour <[EMAIL PROTECTED]> wrote: > > I would certainly appreciate any help I can get on ActiveMapper. > I opened a ticket for an enhancment and uploaded a patch for ActiveMapper.py and the ActiveMapper tests. The test needs more work to simulate a concurrent update a

[sqlalchemy] non-sql storage

2006-10-18 Thread Monty Taylor
So this may sound like a crazy question... If I wanted to implement an interface to a non-SQL based backend (or I wanted to use a direct API to the db bypassing the SQL layer) is there an appropriate place to plug such a thing in and if so where? For it to make sense, I would want to such code in

[sqlalchemy] Re: Mapping with eagerload from arbitrary ResultSet?

2006-10-18 Thread Michael Bayer
hand-constructing the query used by an eagerload is not terribly possible at the moment. if you look at the generated SQL using echoing, the joined tables in an eagerload are "aliased" (to avoid conflicts with multiple eager loads against the same table, WHERE criterion that uses the same

[sqlalchemy] Mapping with eagerload from arbitrary ResultSet?

2006-10-18 Thread James Taylor
I expected to be able to map both sides of the relationship from a resultset with the proper columns. However it appears to still lazy load all the child objects. Short example (works against trunk): import pkg_resources pkg_resources.require( "sqlalchemy" ) pkg_resources.require( "pysqlite"

[sqlalchemy] Re: ActiveMapper, version_id_col

2006-10-18 Thread Jonathan LaCour
Michael Bayer wrote: > support for that argument probably needs to be added. Jonathan, are > you supporting ActiveMapper or should i recruit some more people to > chip in ? Life has been crazy for me for the past few months, and ActiveMapper has suffered as a result. I see things calming down

[sqlalchemy] Re: retrieving and updating using mappers

2006-10-18 Thread Michael Bayer
[EMAIL PROTECTED] wrote: > nuc_word_table.update(nuc_word_table.c.word_id==old_word_id, > nuc_word_table.c.nuc_word_seq_num==oligo1 > ).execute(word_id=new_word_id) > you need the and_ in there: nuc_word_table.update(

[sqlalchemy] Re: Stored procedures

2006-10-18 Thread Michael Bayer
try out the trunk, you can say "select * from func()" now like this: select(['*'], from_obj=[func.my_procedure(1,2,3)]) you can also name the columns: select([column('date', type=DateTime)], from_obj=[func.current_date()]) --~--~-~--~~~---~--~~ You received thi

[sqlalchemy] Re: Bind Parameters, MySQL and Full text search.

2006-10-18 Thread Michael Bayer
id say drop the quotes around the bind parameter. bind parameters dont require any quotes as the value is sent as a separate field in the database conversation. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "sqla

[sqlalchemy] Re: wrong behaviour of Column's "hidden=True" argument

2006-10-18 Thread Michael Bayer
Alexandre CONRAD wrote: > I can see that the "hidden=True" argument is available for a Column > object. But using this argument doesn't seem to make the table function > in any good maner. the "hidden" keyword is only meant for internal usage when generating an "oid" column, which is a quasi-rea

[sqlalchemy] Re: Stored procedures

2006-10-18 Thread Ezio Vernacotola
with  firebird engine I have to write:     this_sql = myengine.text("select * from my_procedure(:field1, :field2, :field3)",     bindparams=[     bindparam('field1', value=100),     bindparam('field2', value=200),

[sqlalchemy] Re: wrong behaviour of Column's "hidden=True" argument

2006-10-18 Thread Alexandre CONRAD
> is a primary_key *AND* is a auto increment (a suggorate key). It seems I think I meant "surrogate key". Call me dyslexic. :) Regards, -- Alexandre CONRAD --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "sqlalch

[sqlalchemy] wrong behaviour of Column's "hidden=True" argument

2006-10-18 Thread Alexandre CONRAD
Hello, I'm working on a web project using Pylons. I'd like to write controllers that would automate form generation (CRUD - Create Read Update Delete). The idea is to look at a SA table and generate the corresponding HTML forms, with error handling. For example, if I see a column that is not

[sqlalchemy] Bind Parameters, MySQL and Full text search.

2006-10-18 Thread Lee McFadden
Hi, I'm trying to use MySQL's full text search in my app and to do that I'm setting up a custom WHERE clause using bind parameters. I'm not sure if I'm doing something wrong, but using bind parameters everything *almost* works. I tested this with the example from MySQL's docs[1]. I've set up t

[sqlalchemy] session.flush() and closed connection + 1 other questions

2006-10-18 Thread François Wautier
Hi, This is my first posting to this list as I am new to SQLAlchemy , so let me express my gratitude to those who develop SQLAlchemy... It's absolutely fabulous... The ORM in particular is fantastic! I am using version 0.2.8 with Python 2.4.3 and MySQL 4.1.21 on an up-to-date Linux Gentoo

[sqlalchemy] Re: Is this possible?

2006-10-18 Thread Michael Bayer
this would basically conflate the concepts of a mapped entity with query criterion. while you can do both queries with the orm Query object, it does not pull criterion from the entity itself. object oriented design principles would generally dictate that a different kind of object should be used

[sqlalchemy] Re: thank you

2006-10-18 Thread Michael Bayer
glad to hear it ! - mike --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To post to this group, send email to sqlalchemy@googlegroups.com To unsubscribe from this group, send email to [EMAIL PRO

[sqlalchemy] Re: ActiveMapper, version_id_col

2006-10-18 Thread Michael Bayer
support for that argument probably needs to be added. Jonathan, are you supporting ActiveMapper or should i recruit some more people to chip in ? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "sqlalchemy" group.

[sqlalchemy] Re: MySQL Has Gone Away

2006-10-18 Thread Michael Bayer
pool_recycle is an integer number of seconds which to wait before reopening a conneciton. However, setting it to "True" is equivalent to 1 which means it will reopen connections constantly. check out the FAQ entry on this: http://www.sqlalchemy.org/trac/wiki/FAQ#MySQLserverhasgoneaway/psycopg.I

[sqlalchemy] Re: retrieving and updating using mappers

2006-10-18 Thread warren . emmett
Thanks for the response, I initially tried that, it doesnt seem to work for multiple statements or my syntax is wrong. I need to be row specific because often i split the rows into more than one new word_id. Originally I tried this statement in several different ways and it didnt work... nuc_wor

[sqlalchemy] Re: session.flush() closing connection

2006-10-18 Thread Michael Bayer
thats a bug. its because the flush() is closing the "connection" you passed to your session. heres a patch that fixes it, which i will try to commit later today but i want to work up some test cases: Index: lib/sqlalchemy/orm/session.py ==

[sqlalchemy] Re: retrieving and updating using mappers

2006-10-18 Thread Michael Bayer
you can just use SQL to issue the updates, using nuc_word_table.update(...). no relations or ORM logic required. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To post to this group, send email

[sqlalchemy] addition of extra characters on returning information from the database.

2006-10-18 Thread warren . emmett
Every time i retrieve information from the database it adds in " u' string' " even though it is saved correctly in the database once i retrieve it it contains this annotation. original in db: 11408855402054064613470328848369 returned from db: u'11239254724221911250033019109105' Is there someway

[sqlalchemy] Re: retrieving and updating using mappers

2006-10-18 Thread warren . emmett
thanks, it does help clarify some of what is bothering me, i think part of my problem is my difficulty to phrase it correctly. My problem is that I have 5 tables that act in cascade. Now I have hundreds of values in each table. the tables look like this... main_seq_table = Table('main_seq_table'

[sqlalchemy] ActiveMapper, version_id_col

2006-10-18 Thread Simon Wittber
I can't remember if I've posted this request before, so I apologise if this is a dupe post. Is there any way I can specify a version_id_col in an ActiveMapper class? -Sw. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Gr

[sqlalchemy] Re: MySQL Has Gone Away

2006-10-18 Thread jlowery
Still same error with: db= create_engine('mysql://[EMAIL PROTECTED]/test', pool_recycle=True) meta = BoundMetaData(db) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To post to this group, send