diff options
author | Dan McGee <dan@archlinux.org> | 2012-07-23 09:45:44 -0500 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2012-07-23 09:55:46 -0500 |
commit | 946d90d08f29094153142056a1778cd595e568a3 (patch) | |
tree | a01ce81fd31d617aec5d4f962e976fe44a3462cf /packages/models.py | |
parent | 872d4bcaa2ce85d2d319a1146e0fc05ab6808eb9 (diff) |
Add '410 Gone' support for packages moved out of repositories
This allows us to do better than a generic 404 handler when we know a
package previously existed in a given repository, and should also make
things a bit nicer when getting sent in from a search engine to a page
that no longer exists.
Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'packages/models.py')
-rw-r--r-- | packages/models.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/packages/models.py b/packages/models.py index 45ff3c08..18a62a3c 100644 --- a/packages/models.py +++ b/packages/models.py @@ -297,6 +297,9 @@ class Update(models.Model): return u'%d:%s-%s' % (self.new_epoch, self.new_pkgver, self.new_pkgrel) return u'%s-%s' % (self.new_pkgver, self.new_pkgrel) + def elsewhere(self): + return Package.objects.filter(pkgname=self.pkgname, arch=self.arch) + def __unicode__(self): return u'%s of %s on %s' % (self.get_action_flag_display(), self.pkgname, self.created) |