to it.
As before, the generated sql is appending WHERE 'devtype' in
'Switch' to the end of the switch = Session.query(Switch)...
statement, which I think is throwing off the subquery results (but I
could be completely wrong).
Thanks,
S.
On Aug 4, 5:11 pm, SQLAlchemy User sqlalchemyu...@gmail.com
Trying again without tab indents. Hopefully the formatting works this
time.
from objects import *
class Device(Base):
__tablename__=testdev
devtype = Column(Unicode(20), primary_key = True)
__mapper_args__ = {'polymorphic_on': devtype}
mac = Column(Unicode(128), primary_key =
On Aug 5, 3:11 pm, Michael Bayer mike...@zzzcomputing.com wrote:
Ultimately you're looking for a self-referential correlation here. In SQL,
that always implies using aliases. Your column_property needs to be against
aliased(PC) and not PC itself.
Thanks - that did the trick. I
...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
I have the following code:
class EventQuery(Query):
def histogram(self):
''' return a histogram of source / count(source) given an eventquery''
...
...
class Event(Base):
__tablename__ = 'events'
query = Session.query_property(query_cls = EventQuery)
name =
On Aug 2, 11:34 am, Michael Bayer mike...@zzzcomputing.com wrote:
values() should be using the least amount of memory of any approach - it only
buffers 10 rows in memory at a time, and doesn't deal with session or object
accounting at all so is also much more performant than all(). I dont
On Jun 2, 6:43 am, Michael Bayer mike...@zzzcomputing.com wrote:
On Jun 2, 2010, at 12:48 AM, SQLAlchemy User wrote:
OK, I get the need for column_property, but the select is fairly
complex and involves unions of the containing class (and it hasn't
been defined yet). How do I get around
Hi all:
Hoping some kind soul on the list will be able to advise on this use/
implementation problem I'm having:
I have two tables (both declarative representations): the first,
Device, describes devices (device ID, import time, other details), and
the second, DeviceState, lists state changes
On Jun 1, 3:31 pm, Michael Bayer mike...@zzzcomputing.com wrote:
On Jun 1, 2010, at 1:06 PM, SQLAlchemy User wrote:
I have two tables (both declarative representations): the first,
Device, describes devices (device ID, import time, other details), and
the second, DeviceState, lists state