Use type hints instead of type declarations in docstrings

Some type declarations in docstrings were outdated. These are fixed
and further all declarations are replaced by type hints.

Google style guide promotes the use of type annotated code:
https://github.com/google/styleguide/blob/gh-pages/pyguide.md#221-type-annotated-code

Upcoming commits should include type hints to be able to make use of
static type checkers as for example mypy.

Issue: HIC-174
Change-Id: I00462d4c6d32ba39e0c7ae9a17aaea98dac9b973
diff --git a/crashreport_stats/models.py b/crashreport_stats/models.py
index e4bb683..461db80 100644
--- a/crashreport_stats/models.py
+++ b/crashreport_stats/models.py
@@ -1,71 +1,76 @@
 """The stats models."""
-from django.db import models
+from django.db.models import (
+    BooleanField,
+    CASCADE,
+    CharField,
+    DateField,
+    DateTimeField,
+    ForeignKey,
+    IntegerField,
+    Model,
+)
 
 
-class _VersionStats(models.Model):
+class _VersionStats(Model):
     """The base class for all-time stats of a version.
 
     Sub-classes should be created to gather stats about a versioned
     end-product such as a software build.
 
     Attributes:
-        is_official_release (models.BooleanField): If this version is an
-            official release. Defaults to False.
-        is_beta_release (models.BooleanField): If this version is a beta
-            release. Defaults to False.
-        first_seen_on (models.DateField): Day this version has been seen for
-            the first time as reported by devices (not by the server). Defaults
-            to the current date.
-        released_on (models.DateField): Day this version has been released on.
-            Defaults to the current date.
-        heartbeats (models.IntegerField): The total heartbeats counted for this
-            version.
-        prob_crashes (models.IntegerField): The total probable crash reports
-            counted for this version.
-        smpl (models.IntegerField): The total SMPL reports counted for this
-            version.
-        other (models.IntegerField): The total of other reports counted for
-            this version.
+        is_official_release:
+            If this version is an official release. Defaults to False.
+        is_beta_release: If this version is a beta release. Defaults to False.
+        first_seen_on:
+            Day this version has been seen for the first time as reported by
+            devices (not by the server). Defaults to the current date.
+        released_on:
+            Day this version has been released on. Defaults to the current date.
+        heartbeats: The total heartbeats counted for this version.
+        prob_crashes: The total probable crash reports counted for this version.
+        smpl: The total SMPL reports counted for this version.
+        other: The total of other reports counted for this version.
 
     """
 
-    is_official_release = models.BooleanField(default=False)
-    is_beta_release = models.BooleanField(default=False)
-    first_seen_on = models.DateField()
-    released_on = models.DateField()
-    heartbeats = models.IntegerField(default=0)
-    prob_crashes = models.IntegerField(default=0)
-    smpl = models.IntegerField(default=0)
-    other = models.IntegerField(default=0)
+    is_official_release = BooleanField(default=False)
+    is_beta_release = BooleanField(default=False)
+    first_seen_on = DateField()
+    released_on = DateField()
+    heartbeats = IntegerField(default=0)
+    prob_crashes = IntegerField(default=0)
+    smpl = IntegerField(default=0)
+    other = IntegerField(default=0)
 
     class Meta:
         abstract = True
 
 
-class _DailyVersionStats(models.Model):
+class _DailyVersionStats(Model):
     """The base class for daily stats of a version.
 
     Sub-classes MUST define the foreign key `version` pointing back to the
     `_VersionStats` implementation they are gathering stats for.
 
     Attributes:
-        date (models.DateField): Day considered for the stats.
-        heartbeats (models.IntegerField): The total heartbeats counted for this
-            version on the day `date`.
-        prob_crashes (models.IntegerField): The total probable crash reports
-            counted for this version on the day `date`.
-        smpl (models.IntegerField): The total SMPL reports counted for this
-            version on the day `date`.
-        other (models.IntegerField): The total of other reports counted for
-            this version on the day `date`.
+        date: Day considered for the stats.
+        heartbeats:
+            The total heartbeats counted for this version on the day `date`.
+        prob_crashes:
+            The total probable crash reports counted for this version on the
+            day `date`.
+        smpl: The total SMPL reports counted for this version on the day `date`.
+        other:
+            The total of other reports counted for this version on the day
+            `date`.
 
     """
 
-    date = models.DateField()
-    heartbeats = models.IntegerField(default=0)
-    prob_crashes = models.IntegerField(default=0)
-    smpl = models.IntegerField(default=0)
-    other = models.IntegerField(default=0)
+    date = DateField()
+    heartbeats = IntegerField(default=0)
+    prob_crashes = IntegerField(default=0)
+    smpl = IntegerField(default=0)
+    other = IntegerField(default=0)
 
     class Meta:
         abstract = True
@@ -75,12 +80,12 @@
     """The all-time stats of a software version.
 
     Attributes:
-        build_fingerprint (models.CharField): The software build fingerprint
-            uniquely identifying this version.
+        build_fingerprint:
+            The software build fingerprint uniquely identifying this version.
 
     """
 
-    build_fingerprint = models.CharField(max_length=200, unique=True)
+    build_fingerprint = CharField(max_length=200, unique=True)
 
     def __str__(self):  # noqa: D105
         return self.build_fingerprint
@@ -90,16 +95,13 @@
     """The daily stats of a software version.
 
     Attributes:
-        version (models.ForeignKey): The software version object (`Version`)
-            these daily stats are about.
+        version:
+            The software version object (`Version`) these daily stats are about.
 
     """
 
-    version = models.ForeignKey(
-        Version,
-        db_index=True,
-        related_name="daily_stats",
-        on_delete=models.CASCADE,
+    version = ForeignKey(
+        Version, db_index=True, related_name="daily_stats", on_delete=CASCADE
     )
 
 
@@ -107,12 +109,12 @@
     """The all-time stats of a radio version.
 
     Attributes:
-        radio_version (models.CharField): The radio version number uniquely
-            identifying this version.
+        radio_version:
+            The radio version number uniquely identifying this version.
 
     """
 
-    radio_version = models.CharField(max_length=200, unique=True)
+    radio_version = CharField(max_length=200, unique=True)
 
     def __str__(self):  # noqa: D105
         return self.radio_version
@@ -122,26 +124,26 @@
     """The daily stats of a radio version.
 
     Attributes:
-        version (models.ForeignKey): The radio version object (`RadioVersion`)
-            these daily stats are about.
+        version:
+            The radio version object (`RadioVersion`) these daily stats are
+            about.
 
     """
 
-    version = models.ForeignKey(
+    version = ForeignKey(
         RadioVersion,
         db_index=True,
         related_name="daily_stats",
-        on_delete=models.CASCADE,
+        on_delete=CASCADE,
     )
 
 
-class StatsMetadata(models.Model):
+class StatsMetadata(Model):
     """The stats metadata.
 
     Attributes:
-        updated_at (models.DateTimeField): The last time the stats were
-            updated.
+        updated_at: The last time the stats were updated.
 
     """
 
-    updated_at = models.DateTimeField()
+    updated_at = DateTimeField()