[llvm-commits] [LNT] r160748 - /lnt/trunk/lnt/server/ui/views.py

Daniel Dunbar daniel at zuster.org
Wed Jul 25 11:23:14 PDT 2012


Author: ddunbar
Date: Wed Jul 25 13:23:14 2012
New Revision: 160748

URL: http://llvm.org/viewvc/llvm-project?rev=160748&view=rev
Log:
lnt.server.ui: Add a .../daily_report short cut that redirects to the most recent daily report.

Modified:
    lnt/trunk/lnt/server/ui/views.py

Modified: lnt/trunk/lnt/server/ui/views.py
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/lnt/server/ui/views.py?rev=160748&r1=160747&r2=160748&view=diff
==============================================================================
--- lnt/trunk/lnt/server/ui/views.py (original)
+++ lnt/trunk/lnt/server/ui/views.py Wed Jul 25 13:23:14 2012
@@ -1078,6 +1078,27 @@
                            graph_plots=graph_plots, legend=legend,
                            use_day_axis=use_day_axis)
 
+ at v4_route("/daily_report")
+def v4_daily_report_overview():
+    # For now, redirect to the report for the most recent submitted run's date.
+
+    ts = request.get_testsuite()
+
+    # Get the latest run.
+    latest = ts.query(ts.Run).\
+        order_by(ts.Run.start_time.desc()).limit(1).first()
+
+    # If we found a run, use it's start time.
+    if latest:
+        date = latest.start_time
+    else:
+        # Otherwise, just use today.
+        date = datetime.date.today()
+
+    return redirect(v4_url_for("v4_daily_report",
+                               year=date.year, month=date.month, day=date.day))
+
+
 @v4_route("/daily_report/<int:year>/<int:month>/<int:day>")
 def v4_daily_report(year, month, day):
     import datetime





More information about the llvm-commits mailing list