Hi everyone!
I have an object graph like this:
Invoice - Detail (one-to-many with cascade) - Product (many-to-one) -
VAT (many-to-one)
My problem is that sometimes if I have a Detail and try to read its
Product, the triggered lazy-loading generates a query more complicated
than necessary,
the left outer join means there is a lazy=False or lazy='joinedload' on the
relationship, or in this case since its sporadic, the parent Invoice is likely
being loaded with an option like joinedload(Product.vat).The options
specified in Query get attached to lazy loaders later in the chain,
thanks, I will start experimenting ...
On Mar 5, 4:52 pm, Michael Bayer mike...@zzzcomputing.com wrote:
On Mar 5, 2011, at 10:43 AM, farcat wrote:
Hi,
I am trying to implement polymorphism and multiple inheritance by:
- adding a column to the parent class/table indicating the
from sqlalchemy import *
meta = MetaData()
stx_setup = Table(stx_setup, meta,
Column('id', BigInteger(display_width=20), primary_key=True, autoincrement=T
rue),
Column('cost_center', Integer(display_width=1), index=True, nullable=True),
Column('AdministratorLicense',
display_width is a MySQL option so you'd want to use
sqlalchemy.dialects.mysql.BIGINT / mysql.INTEGER for that. Not sure why
0.6.6's base BigInteger type allows it.
On Mar 7, 2011, at 5:38 PM, Mike Bernson wrote:
from sqlalchemy import *
meta = MetaData()
stx_setup = Table(stx_setup,
Hello,
Given a scenario where you're using declarative_base(...) and defining
classes
Is there a way to ask SA what the mapper class (declarative) is for a given
table
by inspecting something in metadata[table_name] ?
cheers
James
--
You received this message because you are subscribed to