summaryrefslogtreecommitdiffstats
path: root/packages
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2012-08-01 02:56:49 +0200
committerDan McGee <dan@archlinux.org>2012-08-01 02:56:49 +0200
commit686942b8788fa43031b3999ac00d60baadc82f53 (patch)
treec8c9dda2af8454f382205e627df526d9aa42d83c /packages
parentf5d3c02eb14ea8b0018e17fa9be9c511ad7ebff9 (diff)
downloadarchweb-686942b8788fa43031b3999ac00d60baadc82f53.tar.gz
archweb-686942b8788fa43031b3999ac00d60baadc82f53.tar.xz
Declare 'enums' at class scope
Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'packages')
-rw-r--r--packages/models.py13
1 files changed, 6 insertions, 7 deletions
diff --git a/packages/models.py b/packages/models.py
index 5b48b30..1d538cc 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")