diff --git a/helios/apps.py b/helios/apps.py new file mode 100644 index 0000000000000000000000000000000000000000..90097432826dafdc8670f50a87eaa07403598c70 --- /dev/null +++ b/helios/apps.py @@ -0,0 +1,5 @@ +from django.apps import AppConfig + +class HeliosConfig(AppConfig): + name = 'helios' + verbose_name = "Helios" diff --git a/helios/models.py b/helios/models.py index 96b6654184726d49157df5f8d651ad28cbe99d95..a0d5c12fdd26d1ca2ec1a2f44d487044a93ef43f 100644 --- a/helios/models.py +++ b/helios/models.py @@ -145,6 +145,9 @@ class Election(HeliosModel): # downloadable election info election_info_url = models.CharField(max_length=300, null=True) + class Meta: + app_label = 'helios' + # metadata for the election @property def metadata(self): @@ -649,7 +652,8 @@ class Election(HeliosModel): prettified_result.append({'question': q['short_name'], 'answers': pretty_question}) return prettified_result - + + class ElectionLog(models.Model): """ a log of events for an election @@ -663,6 +667,9 @@ class ElectionLog(models.Model): log = models.CharField(max_length=500) at = models.DateTimeField(auto_now_add=True) + class Meta: + app_label = 'helios' + ## ## UTF8 craziness for CSV ## @@ -702,6 +709,9 @@ class VoterFile(models.Model): processing_finished_at = models.DateTimeField(auto_now_add=False, null=True) num_voters = models.IntegerField(null=True) + class Meta: + app_label = 'helios' + def itervoters(self): if self.voter_file_content: if type(self.voter_file_content) == unicode: @@ -779,7 +789,6 @@ class VoterFile(models.Model): return num_voters - class Voter(HeliosModel): election = models.ForeignKey(Election) @@ -813,6 +822,7 @@ class Voter(HeliosModel): class Meta: unique_together = (('election', 'voter_login_id')) + app_label = 'helios' def __init__(self, *args, **kwargs): super(Voter, self).__init__(*args, **kwargs) @@ -1003,6 +1013,9 @@ class CastVote(HeliosModel): # auditing purposes, like too many votes from the same IP, if it isn't expected cast_ip = models.GenericIPAddressField(null=True) + class Meta: + app_label = 'helios' + @property def datatype(self): return self.voter.datatype.replace('Voter', 'CastVote') @@ -1091,6 +1104,9 @@ class AuditedBallot(models.Model): vote_hash = models.CharField(max_length=100) added_at = models.DateTimeField(auto_now_add=True) + class Meta: + app_label = 'helios' + @classmethod def get(cls, election, vote_hash): return cls.objects.get(election = election, vote_hash = vote_hash) @@ -1107,7 +1123,8 @@ class AuditedBallot(models.Model): query = query[:limit] return query - + + class Trustee(HeliosModel): election = models.ForeignKey(Election) @@ -1140,7 +1157,8 @@ class Trustee(HeliosModel): class Meta: unique_together = (('election', 'email')) - + app_label = 'helios' + def save(self, *args, **kwargs): """ override this just to get a hook diff --git a/helios_auth/apps.py b/helios_auth/apps.py new file mode 100644 index 0000000000000000000000000000000000000000..7d1472ae311ac4ed3066ab8c76f5603ada1f4814 --- /dev/null +++ b/helios_auth/apps.py @@ -0,0 +1,5 @@ +from django.apps import AppConfig + +class HeliosAuthConfig(AppConfig): + name = 'helios_auth' + verbose_name = "Helios Authentication" diff --git a/helios_auth/models.py b/helios_auth/models.py index b9179958e5bbca1ad7d9eacc4c2264c020fecf4b..d0360373c56ebaedabf975799dc823336a060c24 100644 --- a/helios_auth/models.py +++ b/helios_auth/models.py @@ -35,7 +35,8 @@ class User(models.Model): class Meta: unique_together = (('user_type', 'user_id'),) - + app_label = 'helios_auth' + @classmethod def _get_type_and_id(cls, user_type, user_id): return "%s:%s" % (user_type, user_id)