-
Notifications
You must be signed in to change notification settings - Fork 487
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
Reversion with django-taggit #76
Comments
There might well be an issue between the TaggableManager and VersionAdmin. The VersionAdmin code is, sadly, rather arcane, since the standard ModelAdmin class doesn't really have the hooks needed to bolt on django-reversion elegantly. If someone who knows something about django-taggit wants to take a look at this issue, please do! |
+1 :) |
+1 |
2 similar comments
+1 |
+1 |
I'm seeing a list of four enthusiastic django-reversion and django-taggit users above this comment. Any one of you could earn fame and glory by solving this issue! |
I don't understand this issue but in this part:
This is not from taggit. Django forms save the model's data and after that it will save all the m2m data. This is the behavior of Django itself. |
Dear All, My venv with python 3.5: I'm new to django-reversion, I'm trying to understand the app behavior when in the model we have For example, in the Django admin while saving the model (without actually changing any field) and having an empty or not tag field django-reversion creates a Version each time I click on the save button with
Why do we have this behavior? D |
The comment is generated by Saving the model will always save a revision, even if nothing has changed. That's expected behaviour. Anything else generates race conditions in the database, and incurs a performance overhead. |
Closing for lack of activity. |
I'm not entirely sure whether this is your issue or a problem with django-taggit, but I figured I'd post it here (I'm also new to GitHub, so I apologize if I'm doing something wrong).
(If you haven't used django-taggit: TaggedItem has a generic foreign key pointing to the tagged object and a foreign key to a Tag. Tags are basically just a slug. In the admin we see a text field that somehow gets converted into a bunch of TaggedItems when we save the instance.)
I'm trying to use reversion on a model with
tags = TaggableManager(blank=True)
.I've manually registered the Tag and TaggedItem tables using
reversion.register(Tag)
andreversion.register(TaggedItem)
. I registered my model usingreversion.register(MyModel, follow=["tags"])
But in the admin, the Edit / History / Revert page always shows the tags of the newest version, no matter which datetime I click on in the history list.
The database table reversion_version seems to be OK. Taggit chooses to remove all tags and recreate relink them when you save in the admin, so if I add a tag to an object that has one tag I get the following rows in the revision table:
(I'm assuming mode 0 = add, mode 1 = update, mode 2 = remove)
This seems good to me. I'm guessing it isn't actually a revision problem, but a VersionAdmin / TaggableManager issue. I don't understand Django well enough to really understand how TaggableManager affects the model or how VersionAdmin populates the admin form, so this was about as far as I could go.
The text was updated successfully, but these errors were encountered: