Giter VIP home page Giter VIP logo

si364_midterm's Introduction

Functionality

  • user can enter their name and the application will show names that have visited the site
  • user can search for a product using keyword and entering number of item queries they want
  • user can add products to their list by entering their username and product id
  • user can see all the products in their list by entering their username

Functions

  • home: allow user to enter their name, provide navigation to links that have other functionalities
  • all_names: show names that have visited the site
  • search: shows a search form that allow user to search for a product
  • search_result: send request to Walmart API using the product keyword and number of search queries that the user enters in the form, and display product search results
  • add_product: show a form that asks for username and product id, upon entering, save the useranme and sendd a request to Walmart API with the product id to get the product name; create a user object and a product object and then check if the user and product is in databse. If user is not in databse yet, add it to the databse. If the product is in database already, flash message telling the user the product already exists and redirect to the form. If product does not exist, then add the product to database.
  • get_user: show a form that asks for username
  • show_products: get username from the form data, find the user object from the database; then make queries to get the user's products from the product table using the user id; finally, display the products

Models

  • Name (id, name)
  • User (id, username, and has a one-to-many relationship with Product)
  • Prdocut (product_id, user_id, product_name)
  • Review (product_id, product_name, review)

Templates

  • 404.html
  • base.html (for home)
  • name_example.html (for all names)
  • search.html (for search)
  • product_search_results.html (for search_results)
  • add_product.html (for add_product)
  • get_user.html (for get_user)
  • show_products.html (for show_products)
  • add_review.html (for add_review)
  • show_review.html (for show_review)
  • show_all_reviews.html (for show_all_reviews)

Partial checklist of the tasks for instructors

  • Include at least 2 additional template .html files we did not provide. Jinja template for loop: ; Jinja template conditional:

  • At least one additional (not provided) WTForm that sends data with a GET request to a new page. (get_user function)

  • At least one additional (not provided) WTForm that sends data with a POST request to the same page. (add_product function)

  • At least one custom validator for a field in a WTForm. (In Searchform, num_entries has a custom validator)

  • At least 2 additional model classes. (User, Product)

  • Have a one:many relationship that works properly built between 2 of your models. ((User - Product))

  • Successfully query data from each of your models (so query at least one column, or all data, from every database table you have a model for). (show_products function)

  • Query data using an .all() method in at least one view function and send the results of that query to a template. (show_products function, show_products.html)

Aditional requirements

  • Include an additional model class (to make at least 4 total in the application) with at least 3 columns. Save data to it AND query data from it; use the data you query in a view-function, and as a result of querying that data, something should show up in a view. (The data itself should show up, OR the result of a request made with the data should show up. (add_review, show_review, show_all_reviews)

  • Write code in your Python file that will allow a user to submit duplicate data to a form, but will not save duplicate data (In add_product function, the user is NOT able to enter the same username and some product if it is already in database.)

si364_midterm's People

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.