mirror of
https://gitlab2.federez.net/re2o/re2o
synced 2024-11-27 07:02:26 +00:00
Affichage des objets liés quand c'est necessaire (interfaces-machines-domain)
This commit is contained in:
parent
513933abba
commit
5596abf4df
1 changed files with 4 additions and 0 deletions
|
@ -40,6 +40,7 @@ from django.conf import settings
|
||||||
from contributors import contributeurs
|
from contributors import contributeurs
|
||||||
import os
|
import os
|
||||||
import time
|
import time
|
||||||
|
from itertools import chain
|
||||||
import users, preferences, cotisations, topologie, machines
|
import users, preferences, cotisations, topologie, machines
|
||||||
|
|
||||||
def form(ctx, template, request):
|
def form(ctx, template, request):
|
||||||
|
@ -146,6 +147,9 @@ def history(request, application, object_name, object_id):
|
||||||
))
|
))
|
||||||
pagination_number = GeneralOption.get_cached_value('pagination_number')
|
pagination_number = GeneralOption.get_cached_value('pagination_number')
|
||||||
reversions = Version.objects.get_for_object(instance)
|
reversions = Version.objects.get_for_object(instance)
|
||||||
|
if hasattr(instance, 'linked_objects'):
|
||||||
|
for related_object in chain(instance.linked_objects()):
|
||||||
|
reversions = reversions | Version.objects.get_for_object(related_object)
|
||||||
paginator = Paginator(reversions, pagination_number)
|
paginator = Paginator(reversions, pagination_number)
|
||||||
page = request.GET.get('page')
|
page = request.GET.get('page')
|
||||||
try:
|
try:
|
||||||
|
|
Loading…
Reference in a new issue