Alvaro Reinoso wrote:
It works out, thank you! How could I just retrieve some columns from
both tables? For example, if I try to select some columns from Item
and Channel, I get class 'sqlalchemy.util.NamedTuple' when I'd
like to get a channel type with its items:
result =
hi all,
in a polymorphic query, after a 'print' command i realized that SA generates
some columns named 'anon_X', which can be helpful for me.
the question is:
1. is it safe to use those anon_X columns to refine my query?
--- regarding this, my concern is that once the polymorphic query is done
suppose:
summary_table = Table(
'summary', metadata,
Column('ts',Integer, index=True, nullable=False),
Column('url',String, index=True, nullable=False),
Column('hits',Integer, nullable=False),
PrimaryKeyConstraint('ts','url','hits',name='summary_pk'),
Hello, a couple of really basic questions ...
1) How do I write a query beforehand that will be evaluated later at some other
place in the code? (Note that the session hopefully won't exist until that
later time.) Also, certain parameters may need to be passed to the query at
eval time (e.g.
Same behavior with 0.6.3.
On Aug 3, 4:17 pm, Michael Bayer mike...@zzzcomputing.com wrote:
On Aug 3, 2010, at 5:00 PM, Bryan wrote:
Python 2.5.4
MySQL python 1.2.3c1
sqlalchemy 0.5.2
just curious can you try with SQLA 0.6.3 ?
Here is the actual code. It references my object model
On Aug 4, 2010, at 10:34 AM, Gregg Lind wrote:
suppose:
summary_table = Table(
'summary', metadata,
Column('ts',Integer, index=True, nullable=False),
Column('url',String, index=True, nullable=False),
Column('hits',Integer, nullable=False),
nothing wrong with the code I see, and I am noticing that to recreate your test
is taking me longer than one minute, so please provide a fully reproducing test
case.
On Aug 4, 2010, at 11:14 AM, Bryan wrote:
Same behavior with 0.6.3.
On Aug 3, 4:17 pm, Michael Bayer
On Aug 4, 2010, at 10:07 AM, Richard Kuesters wrote:
hi all,
in a polymorphic query, after a 'print' command i realized that SA generates
some columns named 'anon_X', which can be helpful for me.
the question is:
1. is it safe to use those anon_X columns to refine my query?
---
OK, I'll put together a case later today.
On Aug 4, 8:24 am, Michael Bayer mike...@zzzcomputing.com wrote:
nothing wrong with the code I see, and I am noticing that to recreate your
test is taking me longer than one minute, so please provide a fully
reproducing test case.
On Aug 4, 2010,
thanks Michael, that's what i have in mind. since anon_N can't be used, i
was thinking if they can be named or, in other cases, the sql that generates
an anon_N can be extracted?
ps: the object that contains these anon_N columns is a orm.Query object
created from a polymorphic mapper with
On Aug 4, 2010, at 11:51 AM, Richard Kuesters wrote:
thanks Michael, that's what i have in mind. since anon_N can't be used, i was
thinking if they can be named or, in other cases, the sql that generates an
anon_N can be extracted?
ps: the object that contains these anon_N columns is a
Thanks for the advice!
One minor nit. At least in my experience, str(bound query) doesn't
fill the params, or do quoting properly. Here is a demonstration:
fake_table = Table(
'faketable', metadata,
Column('ts',Integer, index=True, nullable=False),
On Aug 4, 2010, at 1:26 PM, Gregg Lind wrote:
Thanks for the advice!
One minor nit. At least in my experience, str(bound query) doesn't
fill the params, or do quoting properly. Here is a demonstration:
fake_table = Table(
'faketable', metadata,
Column('ts',Integer,
Thank you for the more detailed explanation! I will do some
experiments with it!
Gregg
On Aug 4, 12:39 pm, Michael Bayer mike...@zzzcomputing.com wrote:
On Aug 4, 2010, at 1:26 PM, Gregg Lind wrote:
Thanks for the advice!
One minor nit. At least in my experience, str(bound query)
Hello,
I got this error when I've tried to relate some classes:
UnmappedClassError: Class 'zeppelinlib.user.UserTest.User' is not
mapped
I don't get errors when I have relation many-to-many.
This is my file where I store all the User classes.
user_channels = Table(
Hello!
I have two classes that are mapped to tables from different databases.
The classes are defined with declarative_base. I can query each class
individually, but a joined query fails. Here is an example:
from sqlalchemy.orm import
sessionmaker
import sqlalchemy as
sa
from
It seems as though attributes which are dynamic_loaders cannot be told
to eagerly load subattributes which are themselves dynamic_loaders.
IE, A has dynamic_loader for instances of B, which has dynamic_loader
for instances of C.
Assuming we have an instance of A, this works fine:
query =
Solved it. I'm using grok as CMS and didn't realize I have to grok
every component every time when I use it. That's why I got that error.
Thanks anyway!
On Aug 4, 4:27 pm, Alvaro Reinoso alvrein...@gmail.com wrote:
Hello,
I got this error when I've tried to relate some classes:
On Aug 4, 2010, at 5:31 PM, Jon Nelson wrote:
It seems as though attributes which are dynamic_loaders cannot be told
to eagerly load subattributes which are themselves dynamic_loaders.
that is correct. dynamic loaders are not backed by in-memory collections, and
no alternate loader
I have a single-table inheritance setup:
class Device(Base):
__tablename__ = 'devices'
devtype = Column(Unicode(20), nullable = False)
mac = Column(Unicode(128), primary_key = True)
...
class PC(Device):
__mapper_args_ = {'polymorphic_identity':u'PC'}
switch_mac =
...and I've figured out a workaround:
in Switch(Device):
pcs = relationship('PC', primaryjoin = 'Switch.mac ==
PC.switch_mac', lazy='dynamic')
Now, switch.pcs.count() works :)
S.
On Aug 4, 5:00 pm, Zippy P sqlalchemyu...@gmail.com wrote:
I have a single-table inheritance setup:
class
Michael
thanks very much for your helpful advice - the problem seems to
actually involve the autoloading of the table in question.
The table structure is as follows:
CREATE TABLE wcs (
image_id INTEGER NOT NULL,
amp INTEGER
On Aug 4, 2010, at 9:05 PM, jgs9000 wrote:
Michael
thanks very much for your helpful advice - the problem seems to
actually involve the autoloading of the table in question.
so there's a small bug that is easy to fix, that is ticket #1865 and it is
fixed in r742bd985b4e0, latest tip, so
Can someone tell me why this code won't create any tables? The tables
are defined in another file that calls declarative_base().
I presume the problem is that it doesn't know which tables to create. If
so, how do I tell it what tables to create?
Base = declarative_base()
database =
On Wed, Aug 4, 2010 at 9:39 PM, Michael Hipp mich...@hipp.com wrote:
Can someone tell me why this code won't create any tables? The tables are
defined in another file that calls declarative_base().
I presume the problem is that it doesn't know which tables to create. If
so, how do I tell it
25 matches
Mail list logo