Пример #1
0
def my_form_post(names=None,index=None,title=None,ing=None,soda1=None, soda2=None,soda3=None,qa=None,startTime=None,timeA=None,gender=None,length=None,message=None,links=[],parts=[],Creators=[],caLinks=[]):
	links=[]
	parts=[]
	Creators=[]
	caLinks=[]
	startTime=time.time()
	soda1 = request.form['soda1']
	soda2 = request.form['soda2']
	soda3 = request.form['soda3']
	names=den.getPops()
	index=randint(0,len(names)-1)
	title=names[index][0]
	ing=den.getIng(title)
	if soda1!="No Other Soda" and soda2!="No Other Soda" and soda3!="No Other Soda":
		if soda1==soda2 or soda1==soda3 or soda3==soda2:
			message="Please Select Different Drinks"
			return render_template("index.html",message=message,title=title,ing=ing)
	qa=request.form['qa']
	links.append(soda1)
	links.append(soda2)
	links.append(soda3)
	links=den.findDen(links,qa)
	links=den.deleteDuplicates(links)
	for item in links:
		parts.append(den.getIng(item))
		Creators.append(den.getCreator(item))
		caLinks.append(den.getCrLinks(item))
	length=len(links)
	timeA = time.time() - startTime
	return render_template('link.html',links=links,soda3=soda3,soda2=soda2,soda1=soda1,length=length,timeA=timeA,parts=parts,caLinks=caLinks,Creators=Creators)
Пример #2
0
def greet(name,cLink=None,creator=None,ing=None,comments=[]):
	comments=[]
	cLink=den.getCrLinks(name)
	creator=den.getCreator(name)
	ing=den.getIng(name)
	comments=den.getComments(name)
	return render_template("drink.html",name=name,cLink=cLink,creator=creator,ing=ing,comments=comments)
Пример #3
0
def my_form_post(names=None,
                 index=None,
                 title=None,
                 ing=None,
                 soda1=None,
                 soda2=None,
                 soda3=None,
                 qa=None,
                 startTime=None,
                 timeA=None,
                 gender=None,
                 length=None,
                 message=None,
                 links=[],
                 parts=[],
                 Creators=[],
                 caLinks=[]):
    links = []
    parts = []
    Creators = []
    caLinks = []
    startTime = time.time()
    soda1 = request.form['soda1']
    soda2 = request.form['soda2']
    soda3 = request.form['soda3']
    names = den.getPops()
    index = randint(0, len(names) - 1)
    title = names[index][0]
    ing = den.getIng(title)
    if soda1 != "No Other Soda" and soda2 != "No Other Soda" and soda3 != "No Other Soda":
        if soda1 == soda2 or soda1 == soda3 or soda3 == soda2:
            message = "Please Select Different Drinks"
            return render_template("index.html",
                                   message=message,
                                   title=title,
                                   ing=ing)
    qa = request.form['qa']
    links.append(soda1)
    links.append(soda2)
    links.append(soda3)
    links = den.findDen(links, qa)
    links = den.deleteDuplicates(links)
    for item in links:
        parts.append(den.getIng(item))
        Creators.append(den.getCreator(item))
        caLinks.append(den.getCrLinks(item))
    length = len(links)
    timeA = time.time() - startTime
    return render_template('link.html',
                           links=links,
                           soda3=soda3,
                           soda2=soda2,
                           soda1=soda1,
                           length=length,
                           timeA=timeA,
                           parts=parts,
                           caLinks=caLinks,
                           Creators=Creators)
Пример #4
0
def greet(name, cLink=None, creator=None, ing=None, comments=[]):
    comments = []
    cLink = den.getCrLinks(name)
    creator = den.getCreator(name)
    ing = den.getIng(name)
    comments = den.getComments(name)
    return render_template("drink.html",
                           name=name,
                           cLink=cLink,
                           creator=creator,
                           ing=ing,
                           comments=comments)