Gunnerus / gunnerus

Python, Django, Bootstrap 3 and SQLite-based cruise reservation system
2 stars 1 forks source link

Move shared queries to reusable functions #441

Open AudunVN opened 3 years ago

AudunVN commented 3 years ago

We have a lot of code that want the same data (e.g., a specific set of invoices or cruises), but a lot of these use completely separate model query instances. This makes code very hard to maintain, as there is no easy way to find out which queries you should update where if the definition of an object class changes (such as "unfinished invoices").

AudunVN commented 3 years ago

See also 2b8b54fe78e685e7f2d835800bc74fd5d0391669, where I found out that we have five queries that should be identical for the "invoices that need admin attention" case with no obvious way to find and update them when things change.