[sqlalchemy] Re: Foreign key not updated

2007-01-05 Thread Arnar Birgisson
On 1/5/07, Michael Bayer [EMAIL PROTECTED] wrote: yeah see, thats exactly the kind of thing i dont want SA's ORM to get into, because its really thorny..updating the relationship on all child objects. at the very least, it requires loading them all in, cascading the change, etc. it gets pretty

[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 Lee McFadden
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 -- Lee McFadden blog: http://www.splee.co.uk work:

[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] Re: no error when using wrong 'attribute' name on an object

2007-01-05 Thread Michael Bayer
well, theres nothing that says the attribute youre sending in is wrong. classes in python dont have any notion of predeclared attribute names. a mapped class can have any number of other attributes which dont correspond to database-mapped attributes. in your case, you would like to constrain

[sqlalchemy] Re: Saving all transactions against a database (logging queries?)

2007-01-05 Thread Michael Bayer
i havent gotten around to adding docs for logging to the main docs...but its using Python's logging module now. turn off all the echo=True flags and go straight to logging: import logging logging.basicConfig() # see python's logging docs for options

[sqlalchemy] Re: Saving all transactions against a database (logging queries?)

2007-01-05 Thread Brian Jarrett
Excellent. Thank you for the clarification. Brian On 1/5/07, Michael Bayer [EMAIL PROTECTED] wrote: i havent gotten around to adding docs for logging to the main docs...but its using Python's logging module now. turn off all the echo=True flags and go straight to logging: import logging

[sqlalchemy] Re: Column defaults not being created with tables.

2007-01-05 Thread Michael Bayer
yeah...if you want a schema level default, SA calls that a PassiveDefault: users = Table('users', meta, Column('user_id', Integer, primary_key=True), Column('username', String(32), nullable=False), Column('email_address', String(60), unique=True, nullable=False), Column('password',

[sqlalchemy] Transactions

2007-01-05 Thread Paul Johnston
Hi, The following program outputs 1; I thought it should output 0. Any comments? from sqlalchemy import * db = create_engine(sqlite:///:memory:) metadata = BoundMetaData(db) users = Table('users', metadata, Column('user_id', Integer, primary_key=True), Column('user_name', String))

[sqlalchemy] Re: Transactions

2007-01-05 Thread Rick Morrison
You may want to turn on logging to see exactly what SQL is being issued: try adding import logging logging.getLogger('sqlalchemy.engine').setLevel(logging.INFO) to the top of your test script On 1/5/07, Paul Johnston [EMAIL PROTECTED] wrote: Hi, The following program outputs 1; I thought

[sqlalchemy] Re: Saving all transactions against a database (logging queries?)

2007-01-05 Thread Michael Bayer
every other line is a repr() of the bind parameter dictionary sent to the query, so you probably want to grab those separately (they are sent as distinct log lines - not sure why they are munged together in your example above). the query itself is using bind parameters in psycopg2's configured

[sqlalchemy] Re: Saving all transactions against a database (logging queries?)

2007-01-05 Thread Brian Jarrett
Ahhh, that explains it. In my example, I had already removed the crud at the beginning of each line. For anyone else looking to do something similar, you can configure postgres.conf to log the queries it recieves and I get the following in the log file : LOG: statement: UPDATE students SET

[sqlalchemy] Re: Column defaults not being created with tables.

2007-01-05 Thread Jamie
Michael, Thanks for the reply (and the help). --~--~-~--~~~---~--~~ 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,

[sqlalchemy] Re: Saving all transactions against a database (logging queries?)

2007-01-05 Thread jose
Hello Barry, I'm trying to get logging work...I put in my model.py the following code and I expected to see my queries into /tmp/sa.log file, but... what's wrong with it? from turbogears import database from sqlalchemy import Table, relation from sqlalchemy.engine import create_engine from