Advertisement
Guest User

Untitled

a guest
Feb 10th, 2017
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 25.42 KB | None | 0 0
  1. import webapp2, jinja2, os, re, hashutils, sys, logging from google.appengine.ext import db from google.appengine.api import memcache from models import Order, User, Tmp_Order
  2.  
  3. ### Jinja2 Configurations ### template_dir = os.path.join(os.path.dirname(__file__), 'templates') jinja_env = jinja2.Environment(loader = jinja2.FileSystemLoader(template_dir), autoescape = True)
  4.  
  5. class Handler(webapp2.RequestHandler):
  6. """ Utility class for gathering various useful methods that are used by
  7. most request handlers """
  8.  
  9. def get_orders(self, limit, offset):
  10. """
  11. This function will get all the orders by creation date
  12. in (descending) date time stamp. This will be used for admin
  13. functionality only.
  14. """
  15. query = Order.all().order('-created')
  16. return query.fetch(limit=limit, offset=offset)
  17.  
  18. def get_orders_by_user(self, user, limit, offset):
  19. """
  20. This function will get orders by a specific user, ordered by creation date
  21. (descending). The user parameter will be a User object. This will also be
  22. used for admin functionality.
  23. """
  24. # TODO - filter the query so that only orders by the given user
  25. query = Order.all().filter("user", user).order('-created')
  26. return query.fetch(limit=limit, offset=offset)
  27.  
  28. def get_user_by_name(self, username):
  29. """ Get a user object from the db, based on their username """
  30. user = db.GqlQuery("SELECT * FROM User WHERE username = '%s'" % username)
  31. if user:
  32. return user.get()
  33.  
  34. def login_user(self, user):
  35. """ Login a user specified by a User object user """
  36. user_id = user.key().id()
  37. self.set_secure_cookie('user_id', str(user_id))
  38.  
  39. def logout_user(self):
  40. """ Logout a user specified by a User object user """
  41. self.set_secure_cookie('user_id', '')
  42.  
  43. def read_secure_cookie(self, name):
  44. cookie_val = self.request.cookies.get(name)
  45. if cookie_val:
  46. return hashutils.check_secure_val(cookie_val)
  47.  
  48. def set_secure_cookie(self, name, val):
  49. cookie_val = hashutils.make_secure_val(val)
  50. self.response.headers.add_header('Set-Cookie', '%s=%s; Path=/' % (name, cookie_val))
  51.  
  52. def initialize(self, *a, **kw):
  53. """
  54. A filter to restrict access to certain pages when not logged in.
  55. If the request path is in the global auth_paths list, then the user
  56. must be signed in to access the path/resource.
  57. """
  58. webapp2.RequestHandler.initialize(self, *a, **kw)
  59. uid = self.read_secure_cookie('user_id')
  60. self.user = uid and User.get_by_id(int(uid))
  61.  
  62. if not self.user and self.request.path in auth_paths:
  63. self.redirect('/login')
  64.  
  65. class MainPageHandler(Handler):
  66. def render_form(self):
  67. """ Render a page with what the customer has ordered """
  68. t = jinja_env.get_template("mainpage.html")
  69. response = t.render()
  70. self.response.out.write(response)
  71.  
  72. def get(self):
  73. self.render_form()
  74.  
  75. class MenuHandler(Handler):
  76. """ This will be a function to allow the user to create their specific
  77. order from the selected items. """
  78. def render_form(self, unq_id="", product_name="", price="", qty="", body=""):
  79. """ Render the new post form with or without an error, based on parameters """
  80. t = jinja_env.get_template("menu.html")
  81. response = t.render(unq_id=unq_id, product_name=product_name, price=price, qty=qty, body=body)
  82. self.response.out.write(response)
  83.  
  84. def get(self):
  85. self.render_form()
  86.  
  87. def post(self):
  88. unq_id = self.request.get("unq_id")
  89. product_name = self.request.get("product_name")
  90. price = self.request.get("price")
  91. qty = self.request.get("qty")
  92. body = self.request.get("body")
  93. # create new temporary order object and store it in the database
  94. tmp_order = Tmp_Order(unq_id=unq_id,
  95. user=self.user,
  96. product_name=product_name,
  97. price=price,
  98. qty=qty,
  99. body=body)
  100. tmp_order.put()
  101. self.redirect('/cart')
  102.  
  103. class CartHandler(Handler):
  104. """ This will be a function to allow the user to see what they have ordered
  105. from their selections within the menu. """
  106. def update(self, item):
  107. if item.unq_id not in self.content:
  108. self.content.update({item.unq_id: item})
  109. return
  110. for k, v in self.content.get(item.unq_id).items():
  111. if k == 'unq_id':
  112. continue
  113. elif k == 'qty':
  114. total_qty = v.qty + item.qty
  115. if total_qty:
  116. v.qty = total_qty
  117. continue
  118. self.remove_item(k)
  119. else:
  120. v[k] = item[k]
  121.  
  122. def get_total(self):
  123. return sum([v.price * v.qty for _, v in self.content.items()])
  124.  
  125. def get_num_items(self):
  126. return sum([v.qty for _, v in self.content.items()])
  127.  
  128. def remove_item(self, key):
  129. self.content.pop(key)
  130.  
  131. def render_form(self, item_list=""):
  132. # render the page
  133. t = jinja_env.get_template("cart.html")
  134. response = t.render(item_list = item_list)
  135. self.response.out.write(response)
  136.  
  137. def get(self):
  138. self.render_form()
  139.  
  140. def post(self):
  141. self.redirect('/checkout', unq_id=unq_id, product_name=product_name, price=price, qty=qty, body=body)
  142.  
  143. class CheckoutHandler(Handler):
  144. def render_form(self, unq_id="", product_name="", price="", qty="", body=""):
  145. """ Render a page with what the customer has ordered """
  146. t = jinja_env.get_template("checkout.html")
  147. response = t.render(self, unq_id=unq_id, product_name=product_name, price=price, qty=qty, body=body)
  148. self.response.out.write(response)
  149.  
  150. def get(self):
  151. self.render_form()
  152.  
  153. class SignupHandler(Handler):
  154. def validate_username(self, username):
  155. USER_RE = re.compile(r"^[a-zA-Z0-9_-]{3,20}$")
  156. if USER_RE.match(username):
  157. return username
  158. else:
  159. return ""
  160.  
  161. def validate_password(self, password):
  162. PWD_RE = re.compile(r"^.{3,20}$")
  163. if PWD_RE.match(password):
  164. return password
  165. else:
  166. return ""
  167.  
  168. def validate_verify(self, password, verify):
  169. if password == verify:
  170. return verify
  171.  
  172. def validate_email(self, email):
  173. # allow empty email field
  174. if not email:
  175. return ""
  176.  
  177. EMAIL_RE = re.compile(r"^[S]+@[S]+.[S]+$")
  178. if EMAIL_RE.match(email):
  179. return email
  180.  
  181. def get(self):
  182. t = jinja_env.get_template("signup.html")
  183. response = t.render(errors={})
  184. self.response.out.write(response)
  185.  
  186. def post(self):
  187. """
  188. Validate submitted data, creating a new user if all fields are valid.
  189. If data doesn't validate, render the form again with an error.
  190.  
  191. This code is essentially identical to the solution to the Signup portion
  192. of the Formation assignment. The main modification is that we are now
  193. able to create a new user object and store it when we have valid data.
  194. """
  195.  
  196. submitted_username = self.request.get("username")
  197. submitted_password = self.request.get("password")
  198. submitted_verify = self.request.get("verify")
  199. submitted_email = self.request.get("email")
  200. addr1 = self.request.get("addr1")
  201. addr2 = self.request.get("addr2")
  202. city = self.request.get("city")
  203. state = self.request.get("state")
  204. zip = int(self.request.get("zip"))
  205.  
  206. username = self.validate_username(submitted_username)
  207. password = self.validate_password(submitted_password)
  208. verify = self.validate_verify(submitted_password, submitted_verify)
  209. email = self.validate_email(submitted_email)
  210.  
  211. errors = {}
  212. existing_user = self.get_user_by_name(username)
  213. has_error = False
  214.  
  215. if existing_user:
  216. errors['username_error'] = "A user with that username already exists"
  217. has_error = True
  218. elif (username and password and verify and (email is not None) ):
  219. # create new user object and store it in the database
  220. pw_hash = hashutils.make_pw_hash(username, password)
  221. user = User(username=username, pw_hash=pw_hash, email=email, addr1=addr1, addr2=addr2, city=city, state=state, zip=zip)
  222. user.put()
  223. # login our new user
  224. self.login_user(user)
  225. else:
  226. has_error = True
  227.  
  228. if not username:
  229. errors['username_error'] = "That's not a valid username"
  230.  
  231. if not password:
  232. errors['password_error'] = "That's not a valid password"
  233.  
  234. if not verify:
  235. errors['verify_error'] = "Passwords don't match"
  236.  
  237. if email is None:
  238. errors['email_error'] = "That's not a valid email"
  239.  
  240. if has_error:
  241. t = jinja_env.get_template("signup.html")
  242. response = t.render(username=username, email=email, addr1=addr1, addr2=addr2, city=city, state=state, zip=zip, errors=errors)
  243. self.response.out.write(response)
  244. else:
  245. self.redirect('/menu')
  246.  
  247. app = webapp2.WSGIApplication([
  248. ('/', MainPageHandler),
  249. ('/cart', CartHandler),
  250. ('/menu', MenuHandler),
  251. ('/checkout', CheckoutHandler),
  252. ('/signup', SignupHandler),
  253. ('/login', LoginHandler),
  254. ('/logout', LogoutHandler) ], debug=True)
  255.  
  256. # A list of paths that a user must be logged in to access auth_paths = ['/menu', '/cart', '/checkout']
  257.  
  258. {% extends 'base.html' %}
  259.  
  260. {% block content %}
  261.  
  262. <h1>Gigi's Catering Menu</h1>
  263.  
  264. <form method="post">
  265. <label>
  266. <div><h2>Large Gourmet Meat & Cheese Tray</h2></div>
  267. <p>
  268. Fresh Roast Sirloin Beef, Baked Ham, and
  269. Roasted Turkey with Swiss and
  270. American Cheese<br>
  271. Serves 20-25 people
  272. </p>
  273. Price would be $54.99 Per Tray
  274. <input type="hidden" name="unq_id" value="1">
  275. <input type="hidden" name="product_name" value="Large Gourmet Meat & Cheese Tray">
  276. <input type="hidden" name="price" value="54.99">
  277. Qty: <input type="text" name="qty" id="q01" value="{{qty}}">
  278. </label>
  279. <label>
  280. <div><h2>GiGi's Signature Chicken Salad</h2></div>
  281. <h3>Mini Croissants Tray Sold by the Dozen</h3>
  282. Price would be per Dozen $26.99
  283. <input type="hidden" name="unq_id" value="2">
  284. <input type="hidden" name="product_name" value="Chicken Salad Mini Croissants Tray">
  285. <input type="hidden" name="price" value="26.99">
  286. Qty: <input type="text" name="qty" id="q01" value="{{qty}}">
  287. <h3>Chicken Salad Sold by the Pound</h3>
  288. Price would be per Pound $7.99
  289. <input type="hidden" name="unq_id" value="3">
  290. <input type="hidden" name="product_name" value="Chicken Salad Sold by the Pound">
  291. <input type="hidden" name="price" value="7.99">
  292. Qty: <input type="text" name="qty" id="q01" value="{{qty}}">
  293. </label>
  294. <label>
  295. <div><h2>Relish Tray</h2></div>
  296. <p>
  297. Carrot Sticks, Celery Sticks, Olives, and
  298. Butterchip Pickles Served with Ranch Veggie Dip<br>
  299. Serves 10-15 people
  300. </p>
  301. Price would be $19.99 Per Tray
  302. <input type="hidden" name="unq_id" value="4">
  303. <input type="hidden" name="product_name" value="Relish Tray">
  304. <input type="hidden" name="price" value="19.99">
  305. Qty: <input type="text" name="qty" id="q01" value="{{qty}}">
  306. </label>
  307. <label>
  308. <div><h2>Fruit Tray</h2></div>
  309. <p>Strawberries, Grapes, Pineapple, Honey Dew, Cantaloupe, and
  310. Watermelon (when in season)<br>
  311. Serves 15-20 people
  312. </p>
  313. Price would be $39.99 Per Tray
  314. <input type="hidden" name="unq_id" value="5">
  315. <input type="hidden" name="product_name" value="Fruit Tray">
  316. <input type="hidden" name="price" value="39.99">
  317. Qty: <input type="text" name="qty" id="q01" value="{{qty}}">
  318. </label>
  319. <label>
  320. <div><h2>Toasted Ravioli</h2></div>
  321. <p>Served with Marinara Sauce<br>
  322. Serves 15-20 people
  323. </p>
  324. Price would be $19.99 Per Tray
  325. <input type="hidden" name="unq_id" value="6">
  326. <input type="hidden" name="product_name" value="Toasted Ravioli">
  327. <input type="hidden" name="price" value="19.99">
  328. Qty: <input type="text" name="qty" id="q01" value="{{qty}}">
  329. </label>
  330. <label>
  331. <div><h2>3 Foot Party Sub</h2></div>
  332. <p>Fresh Roasted Sirloin Beef, Baked Ham, Hard
  333. Salami, Swiss Cheese, American Cheese, and
  334. Green Leaf Lettuce<br>
  335. Serves 10-15 people
  336. </p>
  337. Price would be $39.99 Each
  338. <input type="hidden" name="unq_id" value="7">
  339. <input type="hidden" name="product_name" value="3 Foot Party Sub">
  340. <input type="hidden" name="price" value="39.99">
  341. Qty: <input type="text" name="qty" id="q01" value="{{qty}}">
  342. </label>
  343. <label>
  344. <div><h2>Wing Tray</h2></div>
  345. <p>You can have your Wing Tray as a Buffalo Wing or Wild Wing. You can
  346. provide further information in the bottom section of this menu.<br>
  347. Serves 15-20 people and costs about $19.99 Per Tray
  348. </p>
  349. Wing Tray - Select This: Buffalo Wing
  350. <input type="hidden" name="unq_id" value="8">
  351. <input type="hidden" name="product_name" value="Buffalo Wing Tray">
  352. <input type="hidden" name="price" value="19.99">
  353. Qty: <input type="text" name="qty" id="q01" value="{{qty}}">
  354. <br><br>
  355. Wing Tray - Select This: Wild Wing
  356. <input type="hidden" name="unq_id" value="9">
  357. <input type="hidden" name="product_name" value="Wild Wing Tray">
  358. <input type="hidden" name="price" value="19.99">
  359. Qty: <input type="text" name="qty" id="q01" value="{{qty}}">
  360. </label>
  361. <label>
  362. <div><h2>GiGi's Fresh Made Potato Chips</h2></div>
  363. <p>Served with a French Onion Dip Tray<br>
  364. Serves 10-15 people
  365. </p>
  366. Price would be $16.99 Per Tray
  367. <input type="hidden" name="unq_id" value="10">
  368. <input type="hidden" name="product_name" value="Potato Chips Served with French Onion Dip Tray">
  369. <input type="hidden" name="price" value="16.99">
  370. Qty: <input type="text" name="qty" id="q01" value="{{qty}}">
  371. </label>
  372. <label>
  373. <div><h2>GiGi's Mini Sweet rolls</h2></div>
  374. <ul>
  375. <li>Ham & Swiss Cheese</li>
  376. <li>Fresh Roasted Sirloin Beef & Cheddar Cheese</li>
  377. <li>Fresh Roasted Turkey & Provel Cheese</li>
  378. <li>$21.99 Per Dozen
  379. </ul>
  380. Price would be Ham and Swiss
  381. <input type="hidden" name="unq_id" value="11">
  382. <input type="hidden" name="product_name" value="Sweet Rolls Ham and Swiss By The Dozen">
  383. <input type="hidden" name="price" value="21.99">
  384. Qty: <input type="text" name="qty" id="q01" value="{{qty}}">
  385. <br>
  386. Price would be Roast Beef and Cheddar Cheese
  387. <input type="hidden" name="unq_id" value="12">
  388. <input type="hidden" name="product_name" value="Sweet Rolls Roast Beef and Cheddar Cheese By The Dozen">
  389. <input type="hidden" name="price" value="21.99">
  390. Qty: <input type="text" name="qty" id="q01" value="{{qty}}">
  391. <br>
  392. Price would be Roasted Turkey and Provel Cheese
  393. <input type="hidden" name="unq_id" value="13">
  394. <input type="hidden" name="product_name" value="Sweet Rolls Roasted Turkey and Provel Cheese By The Dozen">
  395. <input type="hidden" name="price" value="21.99">
  396. Qty: <input type="text" name="qty" id="q01" value="{{qty}}">
  397. </label>
  398. <label>
  399. <div><h2>GiGi's Brownie Tray</h2></div>
  400. <p>Serves 10-15 people</p>
  401. Price would be $19.99 Per Tray
  402. <input type="hidden" name="unq_id" value="14">
  403. <input type="hidden" name="product_name" value="GiGi's Brownie Tray">
  404. <input type="hidden" name="price" value="19.99">
  405. Qty: <input type="text" name="qty" id="q01" value="{{qty}}">
  406. </label>
  407. <label>
  408. <div><h2>Variety Wrap Platter</h2></div>
  409. <p>Our Variety Wrap Platters come with Chicken Caesar, Turkey Ranch, and
  410. Buffalo Chicken Tender w/Ranch
  411. </p>
  412. Price would be $25.99 Per Tray
  413. <input type="hidden" name="unq_id" value="15">
  414. <input type="hidden" name="product_name" value="Variety Wrap Platter">
  415. <input type="hidden" name="price" value="25.99">
  416. Qty: <input type="text" name="qty" id="q01" value="{{qty}}">
  417. </label>
  418. <label>
  419. <div><h2>Tea Sandwiches</h2></div>
  420. <p>GiGi's Signature Chicken Salad or Tuna Salad on Wheatberry Bread<br>
  421. Serves 10-15 people<br>
  422. $25.99 Per Tray</p>
  423. Price would be Chicken Salad
  424. <input type="hidden" name="unq_id" value="16">
  425. <input type="hidden" name="product_name" value="Tea Sandwiches with Chicken Salad on Wheatberry Bread">
  426. <input type="hidden" name="price" value="25.99">
  427. Qty: <input type="text" name="qty" id="q01" value="{{qty}}">
  428. <br>
  429. Price would be Tuna Salad
  430. <input type="hidden" name="unq_id" value="17">
  431. <input type="hidden" name="product_name" value="Tea Sandwiches with Tuna Salad on Wheatberry Bread">
  432. <input type="hidden" name="price" value="25.99">
  433. Qty: <input type="text" name="qty" id="q01" value="{{qty}}">
  434. </label>
  435. <label>
  436. <div><h2>GiGi's Cookie Tray</h2></div>
  437. <p>Our Cookie Trays come with Chocolate Chip and Sugar Cookies<br>
  438. Serves 10-20 people</p>
  439. Price would be $16.99 Per Tray
  440. <input type="hidden" name="unq_id" value="18">
  441. <input type="hidden" name="product_name" value="Gigi's Cookie Tray">
  442. <input type="hidden" name="price" value="16.99">
  443. Qty: <input type="text" name="qty" id="q01" value="{{qty}}">
  444. </label>
  445. <br>
  446. <hr style="height:0px">
  447. <br>
  448. <label>
  449. <div><h1>GiGi's Lunch Boxes</h1></div>
  450. <ul style="list-style-type:disc">
  451. <li><h2>Choice of Meat:</h2></li>
  452. <ul style="list-style-type:square">
  453. <li>Fresh Roasted Sirloin Beef</li>
  454. <input type="checkbox" name="chkbox" value="True"> Select this Item
  455. <input type="hidden" name="unq_id" value="100">
  456. <input type="hidden" name="product_name" value="Lunch Box: Meat - Roast Beef">
  457. Qty: <input type="text" name="qty" id="q01" value="{{qty}}">
  458. <li>Fresh Ham</li>
  459. <input type="checkbox" name="chkbox" value="True"> Select this Item
  460. <input type="hidden" name="unq_id" value="101">
  461. <input type="hidden" name="product_name" value="Lunch Box: Meat - Ham">
  462. Qty: <input type="text" name="qty" id="q01" value="{{qty}}">
  463. <li>Fresh Roasted Turkey</li>
  464. <input type="checkbox" name="chkbox" value="True"> Select this Item
  465. <input type="hidden" name="unq_id" value="102">
  466. <input type="hidden" name="product_name" value="Lunch Box: Meat - Roasted Turkey">
  467. Qty: <input type="text" name="qty" id="q01" value="{{qty}}">
  468. <li>Chicken Salad</li>
  469. <input type="checkbox" name="chkbox" value="True"> Select this Item
  470. <input type="hidden" name="unq_id" value="103">
  471. <input type="hidden" name="product_name" value="Lunch Box: Chicken Salad">
  472. Qty: <input type="text" name="qty" id="q01" value="{{qty}}">
  473. <li>Tuna Salad</li>
  474. <input type="checkbox" name="chkbox" value="True"> Select this Item
  475. <input type="hidden" name="unq_id" value="104">
  476. <input type="hidden" name="product_name" value="Lunch Box: Tuna Salad">
  477. Qty: <input type="text" name="qty" id="q01" value="{{qty}}">
  478. </ul>
  479. <li><h2>Choice of Cheese:</h2></li>
  480. <ul style="list-style-type:square">
  481. <li>Cheddar Cheese</li>
  482. <input type="checkbox" name="chkbox" value="True"> Select this Item
  483. <input type="hidden" name="unq_id" value="110">
  484. <input type="hidden" name="product_name" value="Lunch Box: Cheese - Cheddar">
  485. Qty: <input type="text" name="qty" id="q01" value="{{qty}}">
  486. <li>Swiss Cheese</li>
  487. <input type="checkbox" name="chkbox" value="True"> Select this Item
  488. <input type="hidden" name="unq_id" value="111">
  489. <input type="hidden" name="product_name" value="Lunch Box: Cheese - Swiss">
  490. Qty: <input type="text" name="qty" id="q01" value="{{qty}}">
  491. <li>Provolone Cheese</li>
  492. <input type="checkbox" name="chkbox" value="True"> Select this Item
  493. <input type="hidden" name="unq_id" value="112">
  494. <input type="hidden" name="product_name" value="Lunch Box: Cheese - Provolone">
  495. Qty: <input type="text" name="qty" id="q01" value="{{qty}}">
  496. <li>Pepper Jack Cheese</li>
  497. <input type="checkbox" name="chkbox" value="True"> Select this Item
  498. <input type="hidden" name="unq_id" value="113">
  499. <input type="hidden" name="product_name" value="Lunch Box: Cheese - Pepper Jack">
  500. Qty: <input type="text" name="qty" id="q01" value="{{qty}}">
  501. </ul>
  502. <li><h2>Choice of Bread:</h2></li>
  503. <ul style="list-style-type:square">
  504. <li>Wheatberry</li>
  505. <input type="checkbox" name="chkbox" value="True"> Select this Item
  506. <input type="hidden" name="unq_id" value="120">
  507. <input type="hidden" name="product_name" value="Lunch Box: Bread - Wheatberry">
  508. Qty: <input type="text" name="qty" id="q01" value="{{qty}}">
  509. <li>Hoagie</li>
  510. <input type="checkbox" name="chkbox" value="True"> Select this Item
  511. <input type="hidden" name="unq_id" value="121">
  512. <input type="hidden" name="product_name" value="Lunch Box: Bread - Hoagie">
  513. Qty: <input type="text" name="qty" id="q01" value="{{qty}}">
  514. <li>Pretzel</li>
  515. <input type="checkbox" name="chkbox" value="True"> Select this Item
  516. <input type="hidden" name="unq_id" value="122">
  517. <input type="hidden" name="product_name" value="Lunch Box: Bread - Pretzel">
  518. Qty: <input type="text" name="qty" id="q01" value="{{qty}}">
  519. <li>Croissant</li>
  520. <input type="checkbox" name="chkbox" value="True"> Select this Item
  521. <input type="hidden" name="unq_id" value="123">
  522. <input type="hidden" name="product_name" value="Lunch Box: Bread - Croissant">
  523. Qty: <input type="text" name="qty" id="q01" value="{{qty}}">
  524. </ul>
  525. <li><h2>Choice of a Side Item:</h2></li>
  526. <ul style="list-style-type:square">
  527. <li>Potato Salad</li>
  528. <input type="checkbox" name="chkbox" value="True"> Select this Item
  529. <input type="hidden" name="unq_id" value="130">
  530. <input type="hidden" name="product_name" value="Lunch Box: Side - Potato Salad">
  531. Qty: <input type="text" name="qty" id="q01" value="{{qty}}">
  532. <li>Pasta Salad</li>
  533. <input type="checkbox" name="chkbox" value="True"> Select this Item
  534. <input type="hidden" name="unq_id" value="131">
  535. <input type="hidden" name="product_name" value="Lunch Box: Side - Pasta Salad">
  536. Qty: <input type="text" name="qty" id="q01" value="{{qty}}">
  537. <li>Potato Chips</li>
  538. <input type="checkbox" name="chkbox" value="True"> Select this Item
  539. <input type="hidden" name="unq_id" value="132">
  540. <input type="hidden" name="product_name" value="Lunch Box: Side - Potato Chips">
  541. Qty: <input type="text" name="qty" id="q01" value="{{qty}}">
  542. </ul>
  543. <li><h2>Choice of a Dessert:</h2></li>
  544. <ul style="list-style-type:square">
  545. <li>Brownie</li>
  546. <input type="checkbox" name="chkbox" value="True"> Select this Item
  547. <input type="hidden" name="unq_id" value="140">
  548. <input type="hidden" name="product_name" value="Lunch Box: Dessert - Brownie">
  549. Qty: <input type="text" name="qty" id="q01" value="{{qty}}">
  550. <li>Cookie</li>
  551. <input type="checkbox" name="chkbox" value="True"> Select this Item
  552. <input type="hidden" name="unq_id" value="141">
  553. <input type="hidden" name="product_name" value="Lunch Box: Dessert - Cookie">
  554. Qty: <input type="text" name="qty" id="q01" value="{{qty}}">
  555. </ul>
  556. </ul>
  557. <p>All of our Lunch Box meals come with Lettuce & Tomato.</p>
  558. <p>A Whole Meal In a Box! For $9.49 Each</p>
  559. </label>
  560. <br>
  561. <hr style="height:0px">
  562. <br>
  563. <label>
  564. <div>Additional Comments and/or Special Requests</div>
  565. <textarea name="body">{{body}}</textarea>
  566. </label>
  567. <div class="error">{{ error }}</div>
  568.  
  569.  
  570. <input type="button" value="submit">
  571. <input type="reset"> </form>
  572.  
  573. {% endblock %}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement