Add reversion compare
This commit is contained in:
parent
27d9ea8326
commit
308234166b
5 changed files with 11 additions and 1 deletions
|
@ -234,6 +234,7 @@ INSTALLED_APPS += (
|
|||
'registration',
|
||||
'mptt',
|
||||
'reversion',
|
||||
'reversion_compare',
|
||||
'django_social_share',
|
||||
'social_django',
|
||||
'compressor',
|
||||
|
|
|
@ -36,3 +36,4 @@ admin.site.register(ProblemType, ProblemTypeAdmin)
|
|||
admin.site.register(Profile, ProfileAdmin)
|
||||
admin.site.register(Submission, SubmissionAdmin)
|
||||
admin.site.register(Ticket, TicketAdmin)
|
||||
admin.site
|
||||
|
|
|
@ -11,6 +11,8 @@ from django.urls import reverse_lazy
|
|||
from django.utils.html import format_html
|
||||
from django.utils.translation import gettext, gettext_lazy as _, ungettext
|
||||
from reversion.admin import VersionAdmin
|
||||
from reversion_compare.admin import CompareVersionAdmin
|
||||
|
||||
|
||||
from judge.models import LanguageLimit, Problem, ProblemClarification, ProblemTranslation, Profile, Solution
|
||||
from judge.widgets import AdminHeavySelect2MultipleWidget, AdminSelect2MultipleWidget, AdminSelect2Widget, \
|
||||
|
@ -117,7 +119,7 @@ class ProblemTranslationInline(admin.StackedInline):
|
|||
extra = 0
|
||||
|
||||
|
||||
class ProblemAdmin(VersionAdmin):
|
||||
class ProblemAdmin(CompareVersionAdmin):
|
||||
fieldsets = (
|
||||
(None, {
|
||||
'fields': (
|
||||
|
|
|
@ -26,4 +26,9 @@ revisions.register(Solution)
|
|||
revisions.register(Judge, fields=['name', 'created', 'auth_key', 'description'])
|
||||
revisions.register(Language)
|
||||
revisions.register(Comment, fields=['author', 'time', 'page', 'score', 'body', 'hidden', 'parent'])
|
||||
revisions.register(ProblemTranslation)
|
||||
revisions.register(ProblemPointsVote)
|
||||
revisions.register(ContestMoss)
|
||||
revisions.register(ProblemData)
|
||||
revisions.register(ProblemTestCase)
|
||||
del revisions
|
||||
|
|
|
@ -4,6 +4,7 @@ django-mptt
|
|||
django-pagedown<2
|
||||
django-registration-redux
|
||||
django-reversion
|
||||
django-reversion-compare
|
||||
django-social-share
|
||||
-e git://github.com/DMOJ/django-sortedm2m.git#egg=django-sortedm2m
|
||||
django-impersonate
|
||||
|
|
Loading…
Reference in a new issue