# Patch in support for the debversion field type so that it works during
# reflection
-class DebVersion(sqltypes.UserDefinedType):
+try:
+ # that is for sqlalchemy 0.6
+ UserDefinedType = sqltypes.UserDefinedType
+except:
+ # this one for sqlalchemy 0.5
+ UserDefinedType = sqltypes.TypeEngine
+
+class DebVersion(UserDefinedType):
def get_col_spec(self):
return "DEBVERSION"
def bind_processor(self, dialect):
return None
- def result_processor(self, dialect):
+ # ' = None' is needed for sqlalchemy 0.5:
+ def result_processor(self, dialect, coltype = None):
return None
sa_major_version = sqlalchemy.__version__[0:3]
################################################################################
class Architecture(object):
- def __init__(self, *args, **kwargs):
- pass
+ def __init__(self, arch_string = None, description = None):
+ self.arch_string = arch_string
+ self.description = description
def __eq__(self, val):
if isinstance(val, str):
################################################################################
class Fingerprint(object):
- def __init__(self, *args, **kwargs):
- pass
+ def __init__(self, fingerprint = None):
+ self.fingerprint = fingerprint
def __repr__(self):
return '<Fingerprint %s>' % self.fingerprint
('OverrideSuite', 'overridesuite')]
class Suite(object):
- def __init__(self, *args, **kwargs):
- pass
+ def __init__(self, suite_name = None, version = None):
+ self.suite_name = suite_name
+ self.version = version
def __repr__(self):
return '<Suite %s>' % self.suite_name
################################################################################
+# TODO: remove SuiteArchitecture class
class SuiteArchitecture(object):
def __init__(self, *args, **kwargs):
pass
################################################################################
class Uid(object):
- def __init__(self, *args, **kwargs):
- pass
+ def __init__(self, uid = None, name = None):
+ self.uid = uid
+ self.name = name
def __eq__(self, val):
if isinstance(val, str):
def __setupmappers(self):
mapper(Architecture, self.tbl_architecture,
- properties = dict(arch_id = self.tbl_architecture.c.id))
+ properties = dict(arch_id = self.tbl_architecture.c.id,
+ suites = relation(Suite, secondary=self.tbl_suite_architectures, backref='architectures')))
mapper(Archive, self.tbl_archive,
properties = dict(archive_id = self.tbl_archive.c.id,