Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

View changes of related objects (models.ForeignKey) #80

Open
arogachev opened this issue Sep 19, 2016 · 0 comments
Open

View changes of related objects (models.ForeignKey) #80

arogachev opened this issue Sep 19, 2016 · 0 comments

Comments

@arogachev
Copy link

arogachev commented Sep 19, 2016

I have Enterprise model and related ContactPerson and Phone models:

@reversion.register()
class Enterprise(models.Model):
    # ...

@reversion.register()
class ContactPerson(models.Model):
    enterprise = models.ForeignKey(Enterprise, on_delete=models.CASCADE)
    # Other fields

@reversion.register()
class Phone(models.Model):
    enterprise = models.ForeignKey(Enterprise, on_delete=models.CASCADE)
    # Other fields

In both backend and frontend, these related models are edited together with Enterprise using formsets. For example in admin I define inlines like this:

class EnterpriseAdmin(CompareVersionAdmin):
    inlines = [ContactPersonInline, PhoneInline]

Changes of related models are tracked with main model (for_concrete_model=True and it's True by default, I haven't changed it).

It would be great if in detail compare page I can see changes of each of these related models (including all fields) together with main model.

I see that extension has some support for viewing m2m relations changes, but can't find it for relations with models.ForeignKey.

Now the changes to related models are detectable only from change message and details - by manual comparing (opening one version in one browser tab, second one - in another and manually see what's changed in the forms).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant