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
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
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:
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
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
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
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
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',
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))
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
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
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
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,
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
14 matches
Mail list logo