marcpage / scheduling

Restaurant staff scheduling website
The Unlicense
3 stars 4 forks source link

GM can set class UserLimits #20

Open marcpage opened 2 years ago

marcpage commented 2 years ago

See class UserLimits in model.py

QueTeddy commented 2 years ago

How could I go about solving this?

marcpage commented 2 years ago

Take a look at the referenced class in model.py.

We need a form in the gm section of restaurant.html that can submit the data needed to create that object in the database (maximum hours, notes). We need a new function in model.py to create a new instance of that class. We then have a new entry in scheduling.py that takes that form data and calls the function in model.py to create it.

marcpage commented 2 years ago

To add the employee to the form in restaurant.html, you can now reference the variable employees and have a <select> popup to choose employee.

marcpage commented 2 years ago

@QueTeddy I'm getting to the point where I will need this. Do you want to implement it or should I?

QueTeddy commented 2 years ago

the app won't run.

marcpage commented 2 years ago

What OS are you on and what issues are you seeing?

QueTeddy commented 2 years ago

Ubuntu. Let me show you.

Screenshot from 2022-01-07 00-42-33

marcpage commented 2 years ago

Do you have bash shell installed? I believe it is part of the standard install. The CI/PR build in GitHub also uses Ubuntu and it seems to work fine.

Also, is bash in your path? What happens if you type in bash --version and hit return? On my macOS machine I get:

bash --version GNU bash, version 3.2.57(1)-release (x86_64-apple-darwin17) Copyright (C) 2007 Free Software Foundation, Inc.

If you get an error saying bash is not a command then it would appear you do not have bash.

QueTeddy commented 2 years ago

If I type bash --version I get: GNU bash, version 5.0.17(1)-release (x86_64-pc-linux-gnu) Copyright (C) 2019 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html

This is free software; you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.

which means I have bash installed. If you could put me through the process of you running the app.

marcpage commented 2 years ago

Here are the basics of what the pr_build.sh does:

Run

python3 -m venv /tmp/scheduling
source /tmp/scheduling/bin/activate
pip3 install -qr Requirements.txt
python3 src/scheduling.py --test

Validate Source Format

black src/*.py
pylint src/*.py
flake8 --max-line-length=100 src/*.py