I have the following code:
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 = True)
switch_mac = Column(Unicode(128), ForeignKey(mac))
switch =
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 =
Hi all:
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 =
Hi all,
I have the following:
class Device(Base):
...
source_id = Column(BigInteger, primary_key=True)
...
class EventQuery(Query):
def custommethod():
...
class Event(Base):
__tablename__ = 'events'
query = Session.query.property(query_cls = EventQuery)
...
device_source_id =