When I delete objects and check history I get "There are no deleted objects to recover."

1,176 views
Skip to first unread message

msche...@gmail.com

unread,
Mar 13, 2013, 4:59:55 PM3/13/13
to django-r...@googlegroups.com
For some models everything works fine, for some I cannot get history after I delete, simply I am presented with "There are no deleted objects to recover."

Here is my relevant admin.py

from django.contrib import admin
from django.contrib.auth.models import User
from quiz.models import *

import reversion
from reversion.helpers import patch_admin

class QuizAdmin(reversion.VersionAdmin):
    pass

class QuizQuestionAdmin(reversion.VersionAdmin):
    pass

class QuizQuestionResponseAdmin(reversion.VersionAdmin):
    pass

admin.site.register(Quiz, QuizAdmin)
admin.site.register(QuizQuestion, QuizQuestionAdmin)
admin.site.register(QuizQuestionResponse, QuizQuestionResponseAdmin)

patch_admin(User)

msche...@gmail.com

unread,
Mar 13, 2013, 5:01:11 PM3/13/13
to django-r...@googlegroups.com, msche...@gmail.com
Additionally, the revision data DOES seem to be there in my database, but http://localhost:8000/admin/questionbox/questionboxsubmission/recover/ yeilds no objects to recover

Dave Hall

unread,
Mar 14, 2013, 5:49:11 AM3/14/13
to django-r...@googlegroups.com, msche...@gmail.com
Hi,

Models are considered "deleted" if they have entries in the Version table, but are missing from their own table.

What version of Django and Reversion are you using, and with what database engine? Do all your models have autoincrementing integer primary keys?

Best,

Dave.


--
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 an email to django-r...@googlegroups.com.
Visit this group at http://groups.google.com/group/django-reversion?hl=en-GB.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Matthew Schettler

unread,
Mar 14, 2013, 12:31:52 PM3/14/13
to Dave Hall, django-r...@googlegroups.com
Hi Dave,

Here are the versions I am using

django==1.4.5
Mezzanine==1.4.2
django-debug-toolbar==0.9.4
django-reversion==1.6.6

Matthew Schettler

unread,
Mar 14, 2013, 12:33:41 PM3/14/13
to Dave Hall, django-r...@googlegroups.com
I am using MySQL as a database backend.


Some models I am able to restore via the admin when I delete them; some the "restore" page is just blank with no objects to restore.

I can record a video if it would help,



-Matt

On Mar 14, 2013, at 2:49 AM, Dave Hall <da...@etianen.com> wrote:

Dave Hall

unread,
Mar 14, 2013, 1:38:55 PM3/14/13
to django-r...@googlegroups.com
Hmm...

Are all the models using autoincrementing integer primary keys?

Are you sure that the models are actually being deleted from the database (and not just having an is_deleted flag applied or similar).

msche...@gmail.com

unread,
Mar 14, 2013, 1:46:14 PM3/14/13
to django-r...@googlegroups.com
Yes, I am using the default django model

here is my admin.py and models.py

https://gist.github.com/anonymous/5163462


Additionally, here is the row in the version table that is created when I delete a QuestionBoxSubmission object, and here is the view I get presented with when I go to recover

http://imgur.com/a/YQX21

Dave Hall

unread,
Mar 14, 2013, 1:53:21 PM3/14/13
to django-r...@googlegroups.com
Hmm, very odd.

I'd suggest making a copy of your project, and pulled out bits of it until you find that it starts working. You're the first person to report this issue, so I'm assuming it's something to do with your setup subtly interfering with reversion.

I'd suggest by first removing your custom admin and seeing if the default django admin has the same issue.

Matthew Schettler

unread,
Mar 14, 2013, 2:02:12 PM3/14/13
to django-r...@googlegroups.com
I just stripped my project of all plugins, except for mezzanine, as my project requires it to work. Stripped the admin interface, everything.

Still same issue --- so my guess is it relates to mezzanine or something else odd;

Is there a way I can load the django-reversion code in my project (making it editable so I can debug) rather than using the version pip brought down?


Again, back-end wise the plugin is working fine, it just doesn't present me any objects to recover


-Matt



You received this message because you are subscribed to a topic in the Google Groups "django-reversion discussion group" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/django-reversion/-dU2ju4s8YM/unsubscribe?hl=en-GB.
To unsubscribe from this group and all of its topics, send an email to django-reversi...@googlegroups.com.

Dave Hall

unread,
Mar 15, 2013, 5:55:24 AM3/15/13
to django-r...@googlegroups.com
Yeah, odd. I'd recommend doing a git glone of the repository, symlinking that into your pythonpath and uninstalling your pip version.

I'd be very interested to find out what's going wrong with your site, as you're the first to report this.

Some thing to check
  1. When using ./manage.py shell, what does reversion.get_deleted(QuestionBoxSubmission) return? (This is the method used by recoverlist_view to get the deleted models).
  2. Is the "deleted" template context param being overridden by mezzanine?
Best,

Dave.

Matthew Schettler

unread,
Mar 15, 2013, 12:50:46 PM3/15/13
to django-r...@googlegroups.com
Whats the latest version I should clone to work with django 1.4.5? I believe I tried reversion latest, but as its built for 1.5 it was incompatible.


Removing mezzanine didn't change anything -- not sure if that clears the 2nd case.


If you'd like I can grant you SSH into a clean VM with just my code loaded -- you could do some real debugging. Its a small hobby project and contains nothing I wouldn't mind sharing.



-Matt

Dave Hall

unread,
Mar 15, 2013, 1:31:02 PM3/15/13
to django-r...@googlegroups.com
I will send you my public key shortly. For now, lets continue this conversation outside the mailing list, and report back here when we find out what was going wrong.

Michal

unread,
Aug 26, 2013, 5:35:47 AM8/26/13
to django-r...@googlegroups.com
Hi,

Have you found out what the issue was? I'm having exact same symptoms (revisions saved in the database, but no deleted objects listed in admin). I'm using Django 1.5.1 and Reversion 1.7.1.

Thanks,
Mike

Dave Hall

unread,
Aug 26, 2013, 5:41:40 AM8/26/13
to django-r...@googlegroups.com
No luck, I'm afraid. I never got that SSH access.

--
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 an email to django-r...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages