Closed billpull closed 1 year ago
Those functions being cached might be or not be their defining trait. If that is so then making a separate file with some name containing "cache" makes sense. Otherwise they can either sit along with code calling them or grouped with other related code, with no concern of whether they are cached or not.
Hello, I am relatively new to working within the Django framework and have seen a lot of performance gains using this project and wanted to add some structure to my project in terms of centralizing frequently used cached operations.
I know in the main settings file you can specify timeouts for specific models or apps within the project but I have found more success with translating those to dict or array lookups using the
cached_as
decorator. So for DRY I have been moving those to helper modules but that seems a bit too generic and wanted to see if other people in the community had a file convention they use?Example:
I might have a user module where I want to look up all games they have been in that are active with some other relations.
If I have several of these type of user specific cached functions or QS where would I put that in a django project?