-
-
Notifications
You must be signed in to change notification settings - Fork 93
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
Soft delete #306
base: main
Are you sure you want to change the base?
Soft delete #306
Conversation
- Enable Soft Delete for - BGP Groups - IX - IX Peering Sessions - Direct Peering Sessions - Routing Policies - Communities - Fix views with counts of child objects to not include deleted items - Add manager that combines NetManager and SafeDeleteManager - Make DirectPeeringSessions cascade delete when BGPGroup is deleted - Add migrations
- Create SoftDeleteModel and CascadingSoftDeleteModel to abstract away the SafeDeleteModel - Use a conditional unique constraint on the slug field to allow for deleleted objects with the same unique slug - Inherit Meta class from Abstract Model class *Views* - Use Count with filter instead of Case/When to filter related deleted objects in annotate() - Fix ReturnURLMixin to use return_url instead of default_return_url, since everything seemed to be setting return_url - Fix ReturnURLMixin to ignore deleted objects and fall through to the default return_url - Display validation error messages in BulkDeleteView if we fail validation - Set model_field to None in exception handler for BulkdEditView.post() to ensure the variable is bound.
- Add Soft Delete Admin page - Add link to admin page to menu - Patch SafeDeleteQuerySet.delete() so that it returns the number of deleted objects (compat with standard Queryset) - Add Soft Delete API entry point
…on template objects. - Fix the preview for configuration templates so that it generates a context in the same format as Router.get_configuration_context() - Add a hack in TemplateModel.to_dict() to make it work properly with the template preview.
…into soft-delete
i was just thinking i should have this be a feature you need to enable. otherwise the new functionality will potentially upset people’s existing templates. |
- Add retention period for soft delete, default to changelog retention period - Make command to purge soft deleted object default use the configured retention period
Added the settings to enable the feature and configure the retention period. I'll go take a look at the docker setup to make it line up. It also looks like we have a number of variables missing in the docker environment |
Delayed until a further major release |
This PR has been automatically marked as stale because it has not had recent activity. It will be closed automatically if no further action is taken. |
Keep for tracking purpose |
How high in the priority list is this? I think this is a quite important maintenance feature to keep routers clean. |
This would be great to have. It's unclear why it was never merged, but I assume it'll require more work to get ready to merge now that |
This has been delayed until we have proper heritage between models and be able to define common behaviour across the code base. This work is in progress, but takes time (a lot of time). Once ready, which should happen for 1.8, we will engage a major rewrite of this PR. |
Fixes: #301
deleted
field will record the timestamp of the deletion, which allows for multiple version of a deleted object to exist.deleted
attribute to clean up existing configured objectsCloses: #86