Getting reversion working with the built in Page

183 views
Skip to first unread message

David Novakovic

unread,
Mar 22, 2013, 5:55:09 PM3/22/13
to mezzani...@googlegroups.com
Thought this might help some people. Pretty simple, but non-obvious, especially to people new to contrib.admin


This also adds versioning to RichTextPage as well.

Cheers

David Novakovic

unread,
Mar 22, 2013, 5:56:46 PM3/22/13
to mezzani...@googlegroups.com
@kenbolton has just pointed me to the setting which basically achieves the same thing... so woops!

Stephen McDonald

unread,
Mar 22, 2013, 7:13:47 PM3/22/13
to mezzani...@googlegroups.com
This is a timely thread, I wanted to bring up the reversion integration for more discussion.

The USE_REVERSION setting was recently added - it just puts reversion's admin class into the base admin classes for DisplayableAdmin, which powers most of the admin classes in Mezzanine.

The Mezzanine approach has always been to only include integration with dependencies like this, only if the integration was fairly minimal. I tried out the current reversion integration myself at the time, and there are a few areas (such as Mezzanine pages) where it doesn't actually work properly, and as such the reversion integration isn't applied in the admin interface for pages at least.

There are now a couple of open pull requests that add a whole bunch of code for integrating with reversion in other areas:


To be honest I don't think this code belongs in Mezzanine, and I feel like adding the USE_REVERSION setting may have been a mistake by paving the way for more code like this.

What I'd like to do instead is possibly come up with some approach of being able to define the base classes that get used across the different admin classes in a way that can be configured outside of Mezzanine. An example of this approach is the recent addition of UPLOAD_TO_HANDLERS:


That allows people to define the upload_to arg for any file field, by defining a dict setting that maps app/model/fields to upload handlers in a generic way outside of Mezzanine. Perhaps the same could be done for admin classes.

Finally, do we even need to do this? Is the same thing not achievable simply unregistering/registering your own admin classes? If so I'd be reluctant to even include configurable admin base classes. 



--
You received this message because you are subscribed to the Google Groups "Mezzanine Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mezzanine-use...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 



--
Stephen McDonald
http://jupo.org

David P. Novakovic

unread,
Mar 22, 2013, 7:34:05 PM3/22/13
to mezzani...@googlegroups.com
If there is a simple solution that just needs to be documented I'd be much more in favour of that than overly complex and unclear solutions out of the box.

+1 for deprecating the setting and documenting the simple solution for me


--
You received this message because you are subscribed to a topic in the Google Groups "Mezzanine Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/mezzanine-users/FY_cAZ36MNc/unsubscribe?hl=en.
To unsubscribe from this group and all its topics, send an email to mezzanine-use...@googlegroups.com.

Stephen McDonald

unread,
Mar 22, 2013, 7:39:55 PM3/22/13
to mezzani...@googlegroups.com
Thanks David. 

It sounds like you're working with this at the moment - would you be able to try and work with your original approach (unregister/register) and let us know how you go with that? 

If you're able to get everything working without any changes to Mezzanine, then we could just document the approach and not have to have handling for it in Mezzanine itself.

There might even be room for a separate repo (mezzanine-reversion or some such) that does all the setup/patching required.

David P. Novakovic

unread,
Mar 22, 2013, 7:47:14 PM3/22/13
to mezzani...@googlegroups.com
Will do.. as I understand it, the more complicated stuff is around related models. I'm not up to the blog yet, but I'm sure the commenting stuff will be a bit more interesting than my fairly boring page subclasses at the moment.

Tom Brander

unread,
Mar 23, 2013, 10:13:21 AM3/23/13
to mezzani...@googlegroups.com
Most helpful, I had put reversions in and was just finding some inconsistent behavior that I have yet to fully investigate.. Not sure but I suspect that I see revisions indicated when I use the admin side but not for the front end edits? using a rich text page? Need to test further...

Stephen McDonald

unread,
Mar 29, 2013, 8:10:45 PM3/29/13
to mezzani...@googlegroups.com
I've gone ahead and removed the USE_REVERSION setting for now - don't think it was the right direction.

Nicola Larosa

unread,
Jun 12, 2013, 1:14:23 AM6/12/13
to mezzani...@googlegroups.com
Stephen McDonald wrote:
> If you're able to get everything working without any changes to
> Mezzanine, then we could just document the approach and not have to
> have handling for it in Mezzanine itself.
>
> There might even be room for a separate repo (mezzanine-reversion or
> some such) that does all the setup/patching required.

Any news on this? Is anyone using versioning in production without
USE_REVERSION?

I'd like to finally start actually using Mezzanine, :-) and am going to
need versioning.

Also, the missing versioning feature is sticking out like a sore thumb on
<https://www.djangopackages.com/grids/g/cms/>, and making it harder to
promote Mezzanine in comparison with the alternatives.

--
Nicola Larosa - http://www.tekNico.net/

Mankind's inferiority lies in our inability to reject hierarchical
systems, which all collapse. We are not nature-plus, we are nature-
minus, half-animal half-robot. The robot half needs to go away
if we are to survive. - Dmitry Orlov, October 2012

Stephen McDonald

unread,
Jun 12, 2013, 2:45:08 AM6/12/13
to mezzani...@googlegroups.com
No news - it'll happen when someone needs it badly enough to work on it :-)

--
You received this message because you are subscribed to the Google Groups "Mezzanine Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mezzanine-use...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


David P. Novakovic

unread,
Jun 12, 2013, 4:16:50 AM6/12/13
to mezzani...@googlegroups.com
For what it's worth I'm using reversion as stated in the original thread. I aven't had any problem yet, but it's not a heavy usage site so YMMV.

Cheers,

David


On Wed, Jun 12, 2013 at 3:14 PM, Nicola Larosa <nicola...@gmail.com> wrote:
Reply all
Reply to author
Forward
0 new messages