Пример #1
0
def deleteUser(uid):
	try:
		db.session.delete(user.query.get(uid))
		db.commit()
		return true
	except Exception:
		return false
Пример #2
0
def getCommentsContent(cid) :
	try :
		u = GroupComments.get(cid).first()
		db.session.delete(u)
		db.commit()
		return True
	except Exception :
		return False
Пример #3
0
def setCommentsContent(cid, newContent) :
	try :
		u = GroupComments.get(cid).first()
		u.content = newContent
		db.commit()
		return True
	except Exception :
		return False
Пример #4
0
def setInformsContent(iid, newContent) :
	try :
		u = groupInforms.query.get(iid).first()
		u.content = newContent
		db.commit()
		return True
	except Exception :
		return False
Пример #5
0
def setInformsTitle(iid, newTitle) :
	try :
		u = groupInforms.query.get(iid).first()
		u.title = newTitle
		db.commit()
		return True
	except Exception :
		return False
Пример #6
0
def setInformsGid(iid, tgid) :
	try :
		u = groupInforms.query.get(iid).first()
		u.gid = tgid
		db.commit()
		return True
	except Exception :
		return False
Пример #7
0
def deleteGroupInforms(iid) :
	try :
		u = groupInforms.query.get(iid).first()
		db.session.delete(u)
		db.commit()
		return True
	except Exception :
		return False
Пример #8
0
def createGroupInforms(gid, title, content) :
	try :
		u = groupInforms(gid, title, content)
		db.session.add(u)
		db.commit()
		return u.iid
	except Exception :
		return -1;
Пример #9
0
def deleteUserItems(fid) :
	try :
		u = groupUserItems.query.get(fid).first()
		db.session.delete(u)
		db.commit()
		return True
	except Exception :
		return False
Пример #10
0
def createUserItems(uid, tid) :
	try:
		u = groupUserItems(uid, tid)
		db.session.add(u)
		db.commit()
		return u.tid
	except Exception:
		return -1
Пример #11
0
def createItem(gid, cost, itemName, itemDescription) :
	try:
		u = groupItems(gid, cost, itemName, itemDescription)
		db.session.add(u)
		db.commit()
		return u.tid
	except Exception:
		return -1
Пример #12
0
def createGroupComments(gid, uid, content) :
	try :
		u = GroupComments(gid, uid, content)
		db.session.add(u)
		db.commit()
		return u.cid
	except :
		return -1
	return cid;  # initialization time
Пример #13
0
def update_interface(interface_id):
    print request
    result = request.json()
    print(result)
    data = {
        Intf.interface_name:result['Name'],
        Intf.interface_type: result['Type'],
        Intf.host: result['Host'],
        Intf.url: result['Url'],
        Intf.cookie: result['Cookie'],
        Intf.header: result['Header'],
        Intf.is_sign: result['Sign'],
        Intf.request_sample: result['Request_Sample'],
    }
    db.query(Intf).filter(Intf.id == interface_id).update(data)
    db.commit()
    return redirect(url_for("home.interface"))
Пример #14
0
def createUser(nickname, email, password):
	newUser = user(nickname, "他还没有填写个人简介", email, password)
	db.session.add(newUser)
	db.commit()
	return uid