schimbare history in dashboard
This commit is contained in:
+4
-1
@@ -568,10 +568,13 @@ def dashboard_view(request):
|
||||
pc_hist = Computer.history.all()[:10]
|
||||
mon_hist = Monitor.history.all()[:10]
|
||||
per_hist = Peripheral.history.all()[:10]
|
||||
emp_hist = Employee.history.all()[:10]
|
||||
|
||||
# Combinăm listele și le sortăm descrescător după data acțiunii (history_date)
|
||||
activity_log = sorted(
|
||||
chain(pc_hist, mon_hist, per_hist), key=attrgetter("history_date"), reverse=True
|
||||
chain(pc_hist, mon_hist, per_hist, emp_hist),
|
||||
key=attrgetter("history_date"),
|
||||
reverse=True,
|
||||
)[
|
||||
:10
|
||||
] # Păstrăm doar ultimele 10 cele mai recente acțiuni în total
|
||||
|
||||
Reference in New Issue
Block a user