Skip to content

geoisevil/python_2023

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 

Repository files navigation

This Project is an experiment to demonstrate a few alternative design choices for web development with flask and mysql

Here are a few of the changes:

  • Utilization of a base class for our models to reduce code duplication
  • Using dataclasses for our models to simplify our constructors and implement some helpful dunder methods such as eq
  • Using properties to handle our relationships (this is technically less efficient, but much more readable, and the efficiency difference is negligable at this scale)
  • Custom decorators for our controller routes to reduce code duplication and increase readability
  • utilizing url_for for redirects since it is more consistent, and also is more clear on how to pass variables with a redirect
  • Using app.get and app.post instead of app.route and specifying the methods as it is more consistent with other stacks, and is more readable
  • Decouple message flashing from the validate method and put it into the controllers instead, since it is an interaction with the templates. This also makes it so our models don't have to change whether we are doing ajax validations or regular validations, only the controller does
  • using category filters for our error messages, so they can be displayed below each input instead of grouped together in one spot

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 64.3%
  • HTML 35.7%