django-simple-history

django simple history doesn't show in admin

牧云@^-^@ 提交于 2021-02-11 14:17:20
问题 I have followed the Django-simple-history documentation to display history from the admin page but somehow the history doesn't seem to appear from the admin page. I am using Django version 3.1.2 Here is my admin from django.contrib import admin from simple_history.admin import SimpleHistoryAdmin from .models import Company admin.site.register(Company, SimpleHistoryAdmin) 回答1: You can try this way: Suppose you have only one field in your Company model i.e name field so the model will look as

Revert objects on site instead of admin using django simple history

谁都会走 提交于 2020-02-06 12:51:30
问题 I have employed django simple history package on the admin site to be able to track and revert to previous versions of the object of the model. I am designing a web form that allows users to change instances of the model object using model form on django and would like to allow the users to view and revert to previous versions. Also to allow them to see what are the changes compared to the current version. With the code below I am able to get the list of historical records on my template

Revert objects on site instead of admin using django simple history

我的未来我决定 提交于 2020-02-06 12:50:00
问题 I have employed django simple history package on the admin site to be able to track and revert to previous versions of the object of the model. I am designing a web form that allows users to change instances of the model object using model form on django and would like to allow the users to view and revert to previous versions. Also to allow them to see what are the changes compared to the current version. With the code below I am able to get the list of historical records on my template

How can I store history of ManyToManyField using django-simple-history.

自古美人都是妖i 提交于 2019-12-20 04:48:40
问题 How can I store history of ManyToManyField using django-simple-history. I used HistoricalRecords with attribute m2m_filds but it is throwing error: unexpected keyword argument 'm2m_fields' 回答1: I'm macro1 on GitHub, and I guess de facto maintainer of django-simple-history. From your question it seems that you're just asking about general ManyToManyField support compared with other fields. The short answer is that we do not currently support it. ManyToManyFields actually create an in-between

How can I store history of ManyToManyField using django-simple-history.

时光怂恿深爱的人放手 提交于 2019-12-02 05:38:39
How can I store history of ManyToManyField using django-simple-history. I used HistoricalRecords with attribute m2m_filds but it is throwing error: unexpected keyword argument 'm2m_fields' I'm macro1 on GitHub, and I guess de facto maintainer of django-simple-history. From your question it seems that you're just asking about general ManyToManyField support compared with other fields. The short answer is that we do not currently support it. ManyToManyFields actually create an in-between model that represents the relationship between the two models you're working with. If you want tracking on