Ejemplo n.º 1
0
        return cls


    assigned_to = Foreign(User, '__assigned_to', embedded=True)
    creator = Foreign(User, '__creator', embedded=True)
    qa_contact = Foreign(User, '__qa_contact', embedded=True)


# late bindings
Attachment.bug = Foreign(Bug, 'bug_id')
Bug.dupe_of = Foreign(Bug, '__dupe_of')  # only present if RESOLVED DUPLICATE

# initialize all many fields at once for the sake of DRY
Bug.init_many_fields({
    'attachments': Attachment,
    'blocks': Bug,
    'cc': User,
    'comments': Comment,
    'depends_on': Bug,
    'groups': Group,
    'history': ChangeSet
})


# define authentication methods
auths = AuthList(querystring=QSAuth)

# enable and publish global authentication
auth = enable_auth(auths, BugzillaModel, 'querystring')
Ejemplo n.º 2
0
 def setUp(self):
     self.auth_list = AuthList(a=Mock(), b=Mock())
     self.auth = enable_auth(self.auth_list, MockModel, 'a')