diff options
author | Michael Elkins <melkins@tislabs.com> | 2012-01-17 23:34:16 +0000 |
---|---|---|
committer | Michael Elkins <melkins@tislabs.com> | 2012-01-17 23:34:16 +0000 |
commit | 989f7762afbb222ea841729b99a1e1580496986d (patch) | |
tree | 68d182974da3df05d0bce3793f3adb53e736d7e5 /rpkid/rpki/gui/cacheview/models.py | |
parent | e326b06d9bee7357d5c645321d4c8057166413f9 (diff) |
pull duplicated model for represent AS ranges into abstract model in rpki.gui.models so it can be reused.
svn path=/branches/tk161/; revision=4213
Diffstat (limited to 'rpkid/rpki/gui/cacheview/models.py')
-rw-r--r-- | rpkid/rpki/gui/cacheview/models.py | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/rpkid/rpki/gui/cacheview/models.py b/rpkid/rpki/gui/cacheview/models.py index 598d7f1d..f2249653 100644 --- a/rpkid/rpki/gui/cacheview/models.py +++ b/rpkid/rpki/gui/cacheview/models.py @@ -1,5 +1,8 @@ """ +$Id$ + Copyright (C) 2011 SPARTA, Inc. dba Cobham Analytic Solutions +Copyright (C) 2012 SPARTA, Inc. a Parsons Company Permission to use, copy, modify, and distribute this software for any purpose with or without fee is hereby granted, provided that the above @@ -40,19 +43,7 @@ class AddressRangeV6(rpki.gui.models.PrefixV6): def get_absolute_url(self): return ('rpki.gui.cacheview.views.addressrange_detail_v6', [str(self.pk)]) -class ASRange(models.Model): - min = models.PositiveIntegerField(null=False) - max = models.PositiveIntegerField(null=False) - - class Meta: - ordering = ('min', 'max') - - def __unicode__(self): - if self.min == self.max: - return u'AS%d' % self.min - else: - return u'AS%s-%s' % (self.min, self.max) - +class ASRange(rpki.gui.models.ASN): @models.permalink def get_absolute_url(self): return ('rpki.gui.cacheview.views.asrange_detail', [str(self.pk)]) |