示例#1
0
文件: urls.py 项目: longfan3/contact
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')
示例#2
0
文件: urls.py 项目: longfan3/contact
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")