Open szabozoltan69 opened 3 days ago
Recently it is not possible to set a situation report order, situation reports show randomly on emergency pages. We should use an &ordering=created_at part in the request.
&ordering=created_at
From backend side it would be possible to order by _createdat and name: https://github.com/IFRCGo/go-api/blob/develop/api/drf_views.py#L782-L784 But the client does not send any of them. E.g. https://go.ifrc.org/emergencies/6700/reports : https://goadmin.ifrc.org/api/v2/situation_report/?event=6700&limit=9999 gives this order: Middle East Complex Emergency - SITREP N.2 Middle East Complex Emergency - SITREP N.10 Middle East Complex Emergency - SITREP N.13 Middle East Complex Emergency - SITREP N.1 Middle East Complex Emergency - SITREP N.4 This is not date neither name order.
If we insert an &ordering=created_at
If a more sophisticated version is needed, we can insert a "position" or "order" integer to expicitely being able to define ordering.
Also on backend side Admin it would be nice to – at least – see created_at, because recently it can not be seen anywhere, just in the database.
Could be solved on backend side via https://github.com/IFRCGo/go-api/pull/2275
You can test it on Staging, e.g. on https://go-stage.ifrc.org/emergencies/6700/reports
Issue
Recently it is not possible to set a situation report order, situation reports show randomly on emergency pages. We should use an
&ordering=created_at
part in the request.Details:
From backend side it would be possible to order by _createdat and name: https://github.com/IFRCGo/go-api/blob/develop/api/drf_views.py#L782-L784 But the client does not send any of them. E.g. https://go.ifrc.org/emergencies/6700/reports : https://goadmin.ifrc.org/api/v2/situation_report/?event=6700&limit=9999 gives this order: Middle East Complex Emergency - SITREP N.2 Middle East Complex Emergency - SITREP N.10 Middle East Complex Emergency - SITREP N.13 Middle East Complex Emergency - SITREP N.1 Middle East Complex Emergency - SITREP N.4 This is not date neither name order.
If we insert an
&ordering=created_at
If a more sophisticated version is needed, we can insert a "position" or "order" integer to expicitely being able to define ordering.
Also on backend side Admin it would be nice to – at least – see created_at, because recently it can not be seen anywhere, just in the database.