def host_view(self): host_id = self.request.matchdict['host_id'] host = Host.get_by_id(int(host_id)) buildouts = self.get_buildouts(host_id) return {'host': host, 'main': self.main, 'buildouts': buildouts}
def host_view(self): host_id = self.request.matchdict['host_id'] try: host = Host.get_by_id(int(host_id)) buildouts = self.get_buildouts(host_id) except NoResultFound as e: host = None buildouts = [] return {'host': host, 'main': self.main, 'buildouts': buildouts}
def get(self): host_id = self.request.matchdict.get('host_id') host = Host.get_by_id(host_id) return host.get_as_dict()