Further Study¶
Project Creation Form¶
Make an HTML form that allows users to create a new project.
This will be similar to the new-student form. It should also use a POST request, and it should return a page that acknowledges the project was created, and has a link to the project-info page for that project.
Project descriptions can be long, so it wouldn’t be appropriate to use
an <input type="text">
element for this. Instead, you should
learn about and use an HTML textarea element for this.
Assigning Grades¶
Create a form with two dropdown menus: one listing all students and one listing all projects. Using these menus and a input field for grade so that users can assign a grade for a student for a particular project. Write the handler that actually assigns the grade.
Be careful: a student should only get one grade for a project so, if they already have been graded on a project, you should update that grade, not add a new grade for it. This may require more complex handling for the underlying database component.
Link to this form from the homepage.
Use Jinja Template Inheritance¶
Change your templates to use a base.html template and have the other
templates inherit from this using {% extends 'base.html' %}
. This
will allow you to “factor out” all the common parts of the page while
making a block for the content that changes page-by-page.
Fun: Make it Look Pretty¶
Now that you have template inheritance, it’s easier for you to add some CSS, since you won’t have to edit the CSS stuff on a template-by-template basis.
Add a folder, static/, to your project, and add a styles.css file within that. Have your base.html template use styles.css.
Have fun playing with look and feel!