-
-
Notifications
You must be signed in to change notification settings - Fork 781
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor tables and API for reports and labels #5841
Comments
Supporting generic model relations would be nice, that way plugins could use reports easily. |
This issue seems stale. Please react to show this is still important. |
Still relevant |
Maybe this could be structured as a generic similar to states - consistent code docstrings, fully covered with tests within the module. I would also remove the backend distinction between labels and reports and move everything into one new table to reduce duplications. |
Could also be part of #6417 |
Regarding comments on other threads: I would like to see reports and labels kept separate. They are functionally different enough to warrant separate models and handling
Happy to look at merging existing label tables together, as with merging existing report tables |
@SchrodingersGat do you think this should also apply to the code/database level? We have a lot of duplication in this area currently. Nearly half of our Python code-duplication is between the label and report app and the differences in the API and database make it more difficult than it needs to be. All the things you describe could also be flags on the merged definition - that would also make it possible to use the templating functions more flexibly and document contexts, variables etc dynamically. The amount of support we have around this area is significant. |
I would be for having all in one generic table and adding flags. Having different apis that have different interfaces leads to a lot of codeduplication and messy code on the frontend. While implementing the template editor in the frontend I came up with a collection of things that we should consider now if we refactor that.
|
Maybe this should be a dev call and a task list |
I'm keen to address this properly - a good target for the |
Regarding templates in database we could either use https://django-dbtemplates.readthedocs.io/en/latest/; it is not Dj 4.2 ready but looks nice otherwise or roll our own based on it's idea https://github.com/jazzband/django-dbtemplates/blob/233a401e75d9b6133dd4c9fdc17bf85d2660cc41/dbtemplates/loader.py |
@matmair interesting find! |
The text was updated successfully, but these errors were encountered: