Comments (4)
you are right, the issue happen in the "preview" step. Not sure about your solution, as this could cause the form (and the record) will not validate.
I'm going to add the feature to 'skip' the preview and add a note to use it if ProtectedError
happen.
from django-adminactions.
Any update on this?
from django-adminactions.
I need this functionality and would be willing to write a PR if it will be merged in. I would like some explanation for this code from the preview step:
with transaction.nocommit():
form = MForm(request.POST, instance=master)
other.delete()
form_is_valid = form.is_valid()
I understand you are deleting the other
instance, then validating the master
model, and then rolling back the transaction. But I do not understand why - why do you need to validate the master
instance with the other
instance deleted?
from django-adminactions.
the intention is to invoke model validation, and display errors in a proper way. Using a form Django calls full_clean()
and validate_unique()
on master. This is needed to check that the new instance can be properly saved.
from django-adminactions.
Related Issues (20)
- Fix Documentation about how to use custom MassUpdateForm? HOT 1
- raising validation error when trying to merge instances with ArrayField
- mass_update_fields doesn't work HOT 1
- Configuration of default CSV export settings HOT 1
- Allow callables from the ModelAdmin HOT 1
- Mass update many-to-many field
- Can defaults for the export to CSV/XLS be set via Django config?
- Merge Selected action throws an exception
- create_extra_permissions crashes on occasion
- Charts are not accurate as I have only two entries in database model and it show that you have 9%-9% division in pie chart
- ForeignKey' object has no attribute 'rel' HOT 1
- Let the OperationManager walk the MRO of fields
- Make the OperationManager more convenient to add a function
- Merge action signals HOT 1
- TypeError: ExportMixin.get_export_form() takes 1 positional argument but 3 were given HOT 1
- Mass Update: Type Error HOT 1
- `TemplateSyntaxError 'extra_urls' is not a registered tag library. Must be one of: ...` HOT 2
- Create fixture for a whole app HOT 1
- adminactions.min.css cannot be found
- Merge not working with polymorphic models
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from django-adminactions.