def contactlist(id): contact = Contact.find_first('where id=?',id) if contact is None: raise notfound() contactlist = Contact.find_by('where groupid=?',contact.groupid) if contactlist: return dict(contactlist=contactlist,group=contact.groupid) else: raise APIResourceNotFoundError(contact.groupid,'failed')
def contactlist(id): contact = Contact.find_first("where id=?", id) if contact is None: raise notfound() contactlist = Contact.find_by("where groupid=? and year=? order by headman desc", contact.groupid, contact.year) print("------++++++--") if contactlist: print("----------------") return dict(contactlist=contactlist, group=contact.groupid) else: print("+++++++++++++++++") raise APIResourceNotFoundError(contact.groupid, "failed")