示例#1
0
文件: urls.py 项目: longfan3/contact
def auth():
	i = ctx.request.input(phoneid='')
	phoneid = i.phoneid.strip()
	contact = Contact.find_first('where tel=?',phoneid)
	contact1 = Contact.find_first('where work_tel=?',phoneid)
	if contact:
		return dict(contact)
	elif contact1:
		return dict(contact1)
	else :
		raise APIResourceNotFoundError(phoneid,'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=?',contact.groupid)
	if contactlist:
		return dict(contactlist=contactlist,group=contact.groupid)
	else:
		raise APIResourceNotFoundError(contact.groupid,'failed')
示例#3
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")
示例#4
0
文件: urls.py 项目: longfan3/contact
def welcome(id):
    contact = Contact.find_first("where id=?", id)
    if contact:
        return dict(contact=contact)
    else:
        raise APIResourceNotFoundError(phoneid, "failed")