diff --git a/api/utils/serializer/v1/compensation.py b/api/utils/serializer/v1/compensation.py index fbdbba62..5b38b4cd 100644 --- a/api/utils/serializer/v1/compensation.py +++ b/api/utils/serializer/v1/compensation.py @@ -64,6 +64,7 @@ class CompensationAPISerializerV1(AbstractModelAPISerializerV1, AbstractCompensa obj = Compensation() created = create_action obj.created = created + obj.modified = created obj.geometry = geometry return obj diff --git a/api/utils/serializer/v1/ecoaccount.py b/api/utils/serializer/v1/ecoaccount.py index c3d27867..f2def5ce 100644 --- a/api/utils/serializer/v1/ecoaccount.py +++ b/api/utils/serializer/v1/ecoaccount.py @@ -103,6 +103,7 @@ class EcoAccountAPISerializerV1(AbstractModelAPISerializerV1, obj.legal = Legal() created = create_action obj.created = created + obj.modified = created obj.geometry = geometry return obj diff --git a/api/utils/serializer/v1/ema.py b/api/utils/serializer/v1/ema.py index 4bbb6d9e..8191597c 100644 --- a/api/utils/serializer/v1/ema.py +++ b/api/utils/serializer/v1/ema.py @@ -85,6 +85,7 @@ class EmaAPISerializerV1(AbstractModelAPISerializerV1, AbstractCompensationAPISe ) created = create_action obj.created = created + obj.modified = created obj.geometry = geometry return obj diff --git a/api/utils/serializer/v1/intervention.py b/api/utils/serializer/v1/intervention.py index dca53d72..5f06ccd2 100644 --- a/api/utils/serializer/v1/intervention.py +++ b/api/utils/serializer/v1/intervention.py @@ -76,6 +76,7 @@ class InterventionAPISerializerV1(AbstractModelAPISerializerV1, created = create_action obj.legal = legal obj.created = created + obj.modified = created obj.geometry = geometry obj.responsible = resp return obj diff --git a/compensation/forms/compensation.py b/compensation/forms/compensation.py index 647051d3..d4dd1297 100644 --- a/compensation/forms/compensation.py +++ b/compensation/forms/compensation.py @@ -156,6 +156,7 @@ class NewCompensationForm(AbstractCompensationForm, title=title, intervention=intervention, created=action, + modified=action, is_cef=is_cef, is_coherence_keeping=is_coherence_keeping, is_pik=is_pik, diff --git a/compensation/forms/eco_account.py b/compensation/forms/eco_account.py index dd167c6e..af5f63b5 100644 --- a/compensation/forms/eco_account.py +++ b/compensation/forms/eco_account.py @@ -117,6 +117,7 @@ class NewEcoAccountForm(AbstractCompensationForm, CompensationResponsibleFormMix responsible=responsible, deductable_surface=surface, created=action, + modified=action, comment=comment, is_pik=is_pik, legal=legal diff --git a/compensation/views/compensation/compensation.py b/compensation/views/compensation/compensation.py index 57646895..1e3553a8 100644 --- a/compensation/views/compensation/compensation.py +++ b/compensation/views/compensation/compensation.py @@ -46,6 +46,8 @@ def index_view(request: HttpRequest): compensations = Compensation.objects.filter( deleted=None, # only show those which are not deleted individually intervention__deleted=None, # and don't show the ones whose intervention has been deleted + ).order_by( + "-modified__timestamp" ) table = CompensationTable( request=request, diff --git a/compensation/views/eco_account/eco_account.py b/compensation/views/eco_account/eco_account.py index 1070dfe3..077df148 100644 --- a/compensation/views/eco_account/eco_account.py +++ b/compensation/views/eco_account/eco_account.py @@ -41,6 +41,8 @@ def index_view(request: HttpRequest): template = "generic_index.html" eco_accounts = EcoAccount.objects.filter( deleted=None, + ).order_by( + "-modified__timestamp" ) table = EcoAccountTable( request=request, diff --git a/ema/forms.py b/ema/forms.py index bca72247..b1b59da1 100644 --- a/ema/forms.py +++ b/ema/forms.py @@ -81,6 +81,7 @@ class NewEmaForm(AbstractCompensationForm, CompensationResponsibleFormMixin, Pik title=title, responsible=responsible, created=action, + modified=action, comment=comment, is_pik=is_pik, ) diff --git a/ema/views/ema.py b/ema/views/ema.py index b4ad6fd0..bf171f26 100644 --- a/ema/views/ema.py +++ b/ema/views/ema.py @@ -39,6 +39,8 @@ def index_view(request: HttpRequest): template = "generic_index.html" emas = Ema.objects.filter( deleted=None, + ).order_by( + "-modified__timestamp" ) table = EmaTable( diff --git a/intervention/forms/intervention.py b/intervention/forms/intervention.py index 8086fd7f..10b84e66 100644 --- a/intervention/forms/intervention.py +++ b/intervention/forms/intervention.py @@ -270,6 +270,7 @@ class NewInterventionForm(BaseForm): responsible=responsibility_data, legal=legal_data, created=action, + modified=action, comment=comment, ) diff --git a/intervention/views/intervention.py b/intervention/views/intervention.py index 1bca8968..329e7d5f 100644 --- a/intervention/views/intervention.py +++ b/intervention/views/intervention.py @@ -45,6 +45,8 @@ def index_view(request: HttpRequest): deleted=None, # not deleted ).select_related( "legal" + ).order_by( + "-modified__timestamp" ) table = InterventionTable( request=request,