Skip to content

Add updated_at fields to more models - #4697

Open
jonsch318 wants to merge 3 commits into
TandoorRecipes:developfrom
jonsch318:food-updated_at
Open

Add updated_at fields to more models#4697
jonsch318 wants to merge 3 commits into
TandoorRecipes:developfrom
jonsch318:food-updated_at

Conversation

@jonsch318

Copy link
Copy Markdown
Contributor

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, SupermarketCategory and Unit because 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.

@vabene1111

Copy link
Copy Markdown
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.

@jonsch318

Copy link
Copy Markdown
Contributor Author

no worries take your time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Create updated_at on Food Model

2 participants