chefboyrd.views package¶
Submodules¶
chefboyrd.views.feedbackM module¶
This view is specifically for the administrative staff’s management of the feedback.
written by: Seo Bo Shim, Jarod Morin tested by: Seo Bo Shim debugged by: Seo Bo Shim
-
class
chefboyrd.views.feedbackM.
DateSpecifyForm
(formdata=<object object>, **kwargs)[source]¶ Bases:
flask_wtf.form.FlaskForm
WTforms object for the date-time form submission for the DB query
-
date_time_from
= <UnboundField(DateTimeField, ('Time From',), {})>¶
-
date_time_to
= <UnboundField(DateTimeField, ('Time To',), {})>¶
-
-
class
chefboyrd.views.feedbackM.
ItemTable
(items, classes=None, thead_classes=None, sort_by=None, sort_reverse=False, no_items=None, table_id=None, border=False)[source]¶ Bases:
flask_table.table.Table
FlaskTable object for organizing feedback info into a table
-
body
= <flask_table.columns.Col object>¶
-
time
= <flask_table.columns.Col object>¶
-
-
chefboyrd.views.feedbackM.
delete_feedback
()[source]¶ Calls the delete_feedback function, returns a message confirming # of feedback entries deleted
Returns: Confirmation string Return type: res(str)
-
chefboyrd.views.feedbackM.
delete_twilio_feedback
()[source]¶ Wipe all message history on twilio since a specified time. Only needs to be called once to clear data.
Returns: Confirmation string Return type: res(str)
-
chefboyrd.views.feedbackM.
feedback_table
(role)[source]¶ By default displays a webpage for user to make feedback DB query. Display a table of feedback sent in during a specified date-time range. Also, depending on whether category flags are specified, this page will only display that category table: table of feedback to display form: form that specifies the query instructions.
Parameters: role (str) – correct role of user in this context acquired from the require_role wrapper Returns: The template to display with the appropriate parameters Return type: template
-
chefboyrd.views.feedbackM.
send_sms_route
()[source]¶ This is the directory we need to configure twilio for. Configure Webhook POST for https://{webserver}/feedbackM/twiliosms When Twilio makes a POST request, db will be updated with new sms messages from today
Returns: Confirmation string Return type: res(str)
chefboyrd.views.prediction_dash module¶
Prediction dashboard for the manager interface
Will allow you to predict ingredient usage between two chosen dates
chefboyrd.views.reservationH module¶
Reservation dashboard for the manager interface
-
class
chefboyrd.views.reservationH.
ItemTable
(items, classes=None, thead_classes=None, sort_by=None, sort_reverse=False, no_items=None, table_id=None, border=False)[source]¶ Bases:
flask_table.table.Table
This is a itemTable class that generates text/html automatically to create a table for created reservations
-
cancel
= <flask_table.columns.ButtonCol object>¶
-
guests
= <flask_table.columns.Col object>¶
-
html_attrs
= {'class': 'table table-striped'}¶
-
name
= <flask_table.columns.Col object>¶
-
phone
= <flask_table.columns.Col object>¶
-
table
= <flask_table.columns.Col object>¶
-
time
= <flask_table.columns.Col object>¶
-
-
class
chefboyrd.views.reservationH.
ReservationForm
(formdata=<object object>, **kwargs)[source]¶ Bases:
flask_wtf.form.FlaskForm
This is the form that displays fields to make a reservation
-
length
= <UnboundField(IntegerField, ('Reservation Length(Minutes)', [<wtforms.validators.NumberRange object>]), {})>¶
-
name
= <UnboundField(StringField, ('Name', [<wtforms.validators.Length object>]), {})>¶
-
num
= <UnboundField(IntegerField, ('Guests', [<wtforms.validators.NumberRange object>]), {})>¶
-
phone
= <UnboundField(PhoneNumberField, ('Phone Number', [<wtforms.validators.DataRequired object>]), {})>¶
-
start
= <UnboundField(DateTimeField, ('Time and Date',), {})>¶
-
chefboyrd.views.root module¶
This is a sample blueprint for a homepage
Because we’re going to have multiple views for the project we need a way to break them up easily within our application. Flask provides us with this neat tool called blueprints where we’re able to define, essentially, chunks of our APIs or programs as blueprints with functions, then map the predefined functions to specific routes in our application. (See the __init__.py file) for blueprint registering.
To create a new routable location as part of the view you need to first create the blueprint for the module. This is done with the following code
page = Blueprint(‘main’, __name__, template_folder=’templates’)
Then you can use the function decorator @page.route(...) to decorate methods in order to create the views. See the example below. I think the code is relatively straightforward.
Read the flask documentation if you have issues. Particularly the following pages:
Dive deeper into the documentation for a better understanding of how this all works.
chefboyrd.views.stat_dash module¶
Statistics dashboard for the manager interface
Will be able to render dashboards which include statistics from the database of the Point of sale system and other data systems for the business.
chefboyrd.views.table_manager module¶
Table dashboard for the manager interface TO DO: Limit reservation times to after date,limit guests based on table(going to be hard)hmm
-
class
chefboyrd.views.table_manager.
ItemTable
(items, classes=None, thead_classes=None, sort_by=None, sort_reverse=False, no_items=None, table_id=None, border=False)[source]¶ Bases:
flask_table.table.Table
This itemTable class generates a table of the created reservations. It also has buttons to cancel or confirm a reservation
-
cancel
= <flask_table.columns.ButtonCol object>¶
-
confirm
= <flask_table.columns.ButtonCol object>¶
-
guests
= <flask_table.columns.Col object>¶
-
html_attrs
= {'class': 'table table-striped'}¶
-
name
= <flask_table.columns.Col object>¶
-
phone
= <flask_table.columns.Col object>¶
-
table
= <flask_table.columns.Col object>¶
-
time
= <flask_table.columns.Col object>¶
-
-
chefboyrd.views.table_manager.
add_table
()[source]¶ This handles when a user adds a table to the layout.
-
chefboyrd.views.table_manager.
cancel
()[source]¶ This handles when a user needs to cancel a reservation.
-
chefboyrd.views.table_manager.
change_table
()[source]¶ This handles when a user needs to change the status of a table.
-
chefboyrd.views.table_manager.
confirm
()[source]¶ This handles when a user needs to confirm a reservation.
-
chefboyrd.views.table_manager.
del_table
()[source]¶ This handles when a user adds a table to the layout.