summaryrefslogtreecommitdiff
path: root/packages/models.py
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2012-07-31 19:56:49 -0500
committerDan McGee <dan@archlinux.org>2012-07-31 19:56:49 -0500
commit686942b8788fa43031b3999ac00d60baadc82f53 (patch)
treec8c9dda2af8454f382205e627df526d9aa42d83c /packages/models.py
parentf5d3c02eb14ea8b0018e17fa9be9c511ad7ebff9 (diff)
Declare 'enums' at class scope
Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'packages/models.py')
-rw-r--r--packages/models.py13
1 files changed, 6 insertions, 7 deletions
diff --git a/packages/models.py b/packages/models.py
index 5b48b30f..1d538cce 100644
--- a/packages/models.py
+++ b/packages/models.py
@@ -196,13 +196,6 @@ class FlagRequest(models.Model):
return u'%s from %s on %s' % (self.pkgbase, self.who(), self.created)
-UPDATE_ACTION_CHOICES = (
- (ADDITION, 'Addition'),
- (CHANGE, 'Change'),
- (DELETION, 'Deletion'),
-)
-
-
class UpdateManager(models.Manager):
def log_update(self, old_pkg, new_pkg):
'''Utility method to help log an update. This will determine the type
@@ -249,6 +242,12 @@ class UpdateManager(models.Manager):
class Update(models.Model):
+ UPDATE_ACTION_CHOICES = (
+ (ADDITION, 'Addition'),
+ (CHANGE, 'Change'),
+ (DELETION, 'Deletion'),
+ )
+
package = models.ForeignKey(Package, related_name="updates",
null=True, on_delete=models.SET_NULL)
repo = models.ForeignKey(Repo, related_name="updates")