Multi-table inheritance-- save ordering bug

23 views
Skip to first unread message

liam.p...@gmail.com

unread,
Mar 11, 2017, 6:50:00 PM3/11/17
to django-reversion discussion group
I have a group of versioned models that inherit from a concrete base model:

# MODELS

class Content(models.Model):
   
# fields...
   
pass

class Story(Content):
   
# more fields...
   
pass

class Video(Content):
   
# more fields...
   
pass

# ADMIN

class ContentAdmin(VersionAdmin):
    model
= Content

class StoryAdmin(ContentAdmin):
    model
= Story

class VideoAdmin(ContentAdmin):
    model
= Video


For half of my Story and Video objects, when I go to a revision view, all of the formfields are completely blank. It's happening whenever the parent Content's version has a higher pk than (i.e. was created after) the child's version. But when the child's version reverts before the parent's everything is fine. It looks like the ordering of versions on save/revert doesn't matter in the current code. Has anyone seen something like this before? Any suggestions for the best way around it? I looked at the pre_revision_commit signal but couldn't find an easy way to change the version order there.

python 2.7, Django 1.8, django-reversion==2.0.7

Thanks!

Dave Hall

unread,
Mar 14, 2017, 6:26:13 AM3/14/17
to django-reversion discussion group
This is really strange, as the save order shouldn't matter. Could you raise an issue on the issue tracker, and we'll take it from there?

--
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.
Reply all
Reply to author
Forward
0 new messages