Clarification on automatic revisions and context managers

31 views
Skip to first unread message

jmor...@minervaproject.com

unread,
May 18, 2016, 8:29:15 PM5/18/16
to django-reversion discussion group
Hello!  Really enjoying working with django-reversion so far.  I think I've finished my initial integration, and then read something in the documentation that gave me pause.

By default, django-reversion saves a new revision whenever a model is saved, using the post_save signal. 

But that's not actually true, right?  From reading the source and using django-reversion, it seems that in addition to registering models of interest that I have to manage the creation of Revisions myself (through middleware, explicitly calling create_revision, etc.), and that the operation that gets automatically performed by RevisionManager._signal_receiver is the addition of a Version into the Revision's context.  There's no save to the database going on  until we exit the create_revision context or call revision_context_manager.end().

Do I understand correctly?  Thanks!

Dave Hall

unread,
May 19, 2016, 9:54:15 AM5/19/16
to django-reversion discussion group
Yes, you understand correctly. The documentation is a little unclear on this. If you could raise an issue about it on the project issue tracker, I'll attend to it next week.
--
You received this message because you are subscribed to the Google Groups "django-reversion discussion group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-reversi...@googlegroups.com.
To post to this group, send email to django-r...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-reversion.
For more options, visit https://groups.google.com/d/optout.

jmor...@minervaproject.com

unread,
May 19, 2016, 12:07:14 PM5/19/16
to django-reversion discussion group
Thanks Dave!  I've opened https://github.com/etianen/django-reversion/issues/523

Thanks again for django-reversion - it's been a real pleasure to work with.  The archive of discussions in the group here have been very helpful as well
Reply all
Reply to author
Forward
0 new messages