dominno / django-moderation

django-moderation is reusable application for Django framework, that allows to moderate any model objects.
BSD 3-Clause "New" or "Revised" License
269 stars 91 forks source link

Revival for 1.5.1? #77

Closed danielbraun closed 10 years ago

danielbraun commented 11 years ago

It's a shame this simply doesn't work for the current Django version. Tried to run the tests, which seem like a mess (Why in multiple threads?) The API itself is beautiful and I wish it worked. Maybe a test rewrite is required? I would really like to use this app for my project.

treyhunner commented 11 years ago

I no longer use this project for any of the websites I currently maintain (no need for moderation currently).

My suggestions for someone who wants to step up and revive a fork of this project (which would hopefully be merged into this version instead of causing competing forks):

I doubt it would be too difficult to get this project working with Django 1.5. It's probably mostly a matter of changing the urls.py files for the new urlconf path (if that's necessary) and changing the {% url %} template tags to use the new syntax (importing from future). Not too much changed drastically between Django 1.3, 1.4, and 1.5 besides that.

danielbraun commented 11 years ago

Thanks for the response. I just want to add that it DOES work! Apparently when you create an object via the shell, the admin says "This object is not registered with the moderation system."

Which is totally fine, except that this example:

your_model = YourModel(description='test')
your_model.save()

YourModel.objects.get(pk=your_model.pk)
Traceback (most recent call last):
DoesNotExist: YourModel matching query does not exist.

It misled me, as I was not able to reproduce it, and it confused me.

dominno commented 10 years ago

Hi @danielbraun,

This is because original objects manager is overwritten by moderation manager, and when you create object then by default its to possible to get it with objects manager, it need to be approved first. You can either try to use unmoderated_objects manager

YourModel.unmoderated_objects.get(pk=your_model.pk)

Or first approve the object to be available.

your_model.moderated_object.approve(user)

then

YourModel.objects.get(pk=your_model.pk)

will work

dominno commented 10 years ago

@treyhunner I have added

Please let me know if there is anything to add in the CONTRIBUTING.rst