################################################################################
-class Uid(object):
+class Uid(ORMObject):
def __init__(self, uid = None, name = None):
self.uid = uid
self.name = name
# This signals to use the normal comparison operator
return NotImplemented
- def __repr__(self):
- return '<Uid %s (%s)>' % (self.uid, self.name)
+ def properties(self):
+ return ['uid', 'name', 'fingerprint']
+
+ def not_null_constraints(self):
+ return ['uid']
__all__.append('Uid')
mapper(Uid, self.tbl_uid,
properties = dict(uid_id = self.tbl_uid.c.id,
- fingerprint = relation(Fingerprint)))
+ fingerprint = relation(Fingerprint)),
+ extension = validator)
mapper(UploadBlock, self.tbl_upload_blocks,
properties = dict(upload_block_id = self.tbl_upload_blocks.c.id,
self.session.rollback()
self.assertRaises(IntegrityError, self.fingerprint_duplicate_fingerprint)
self.session.rollback()
- self.assertRaises(IntegrityError, self.uid_no_uid)
+ self.assertRaises(DBUpdateError, self.uid_no_uid)
self.session.rollback()
self.assertRaises(IntegrityError, self.uid_duplicate_uid)
self.session.rollback()