Add updated_at fields to more models - #4697
Open
jonsch318 wants to merge 3 commits into
Open
Conversation
Collaborator
|
thank you, that makes sense for offline clients. I will review it and try to get it merged with one of the next releases. Sorry that things are a bit slow at the moment as I am extremly busy IRL and also have smilerzs big batch of PRs that I promised to look at before breaking them all with changes first. |
Contributor
Author
|
no worries take your time. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This would resolve #4672.
From a client perspective like kitshn updated_at filters are nice because they allow for better synchronization without much hassle since we can get only the newest updates after the last synchronization.
I started with
Food,SupermarketCategoryandUnitbecause they were already using the StandardFilterModelViewSet which allowed updated_at queries but the models where missing the property, which i added. I would be fine with change only but I thought it would be better if most mutable models would allow for updated_at queries and it would be better to do it in one swoop than multiple times later on requiring a migration.Since many do not derive the StandardFilterModelViewSet i added a new smaller UpdatedAtFilterBackend. I needed to use the BaseFilterBackend with get_schema_operation_parameters so that the query documentation is correct.
I also added tests for the updated_at filter.
There are some models like Logs, Space, FoodProperty, Space, ConnectorConfig but I think these are fine and not really that change frequent.
I tried generating the vue3 openapi client but many many things changed especially .openapi-generator/FILES which some where removed for some reason idk. So I did not want to clutter up this PR. Just say that I should include it if thats wanted.