Add constants for boot reasons

Create constants for known boot reason in the Crashreport model.

All occurences of these strings are changed to use the constants, except
raw SQL queries.

Issue: HIC-143
Change-Id: I358a05b0dde408f9a5595c96c37c2dddaeb2b215
diff --git a/crashreport_stats/rest_endpoints.py b/crashreport_stats/rest_endpoints.py
index 1e6e998..6378d01 100644
--- a/crashreport_stats/rest_endpoints.py
+++ b/crashreport_stats/rest_endpoints.py
@@ -63,9 +63,9 @@
         device          = Device.objects.filter(uuid=uuid)
         last_active     = HeartBeat.objects.filter(device=device).order_by('-date')[0].date
         heartbeats      = HeartBeat.objects.filter(device=device).count()
-        crashreports    = Crashreport.objects.filter(device=device).filter(boot_reason__in=["UNKNOWN", "keyboard power on"]).count()
+        crashreports    = Crashreport.objects.filter(device=device).filter(boot_reason__in=Crashreport.CRASH_BOOT_REASONS).count()
         crashes_per_day = crashreports*1.0/heartbeats if heartbeats > 0 else 0
-        smpls           = Crashreport.objects.filter(device=device).filter(boot_reason__in=["RTC alarm"]).count()
+        smpls           = Crashreport.objects.filter(device=device).filter(boot_reason__in=Crashreport.SMPL_BOOT_REASONS).count()
         smpl_per_day    = smpls*1.0/heartbeats if heartbeats > 0 else 0
         return Response(
             {