diff options
author | Michael Elkins <melkins@tislabs.com> | 2012-11-10 03:59:20 +0000 |
---|---|---|
committer | Michael Elkins <melkins@tislabs.com> | 2012-11-10 03:59:20 +0000 |
commit | 71b39fcb72eaa25d77a9f12d87dd906b2982bc81 (patch) | |
tree | 0a6f090f9e425b1f5b9a627263da2351174052db /rpkid/rpki/gui/app/models.py | |
parent | bb3079fb281d8c2e65c8309fec41a59f50e05a7c (diff) |
merge with ^/tk316
add db migrations
svn path=/branches/tk316_317_integration/; revision=4828
Diffstat (limited to 'rpkid/rpki/gui/app/models.py')
-rw-r--r-- | rpkid/rpki/gui/app/models.py | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/rpkid/rpki/gui/app/models.py b/rpkid/rpki/gui/app/models.py index 8b93fbfa..2c5a81d4 100644 --- a/rpkid/rpki/gui/app/models.py +++ b/rpkid/rpki/gui/app/models.py @@ -120,8 +120,13 @@ class ResourceCert(models.Model): This model is used to cache the output of <list_received_resources/>. """ - # pointer to the parent object in the irdb - parent = models.ForeignKey(Parent, related_name='certs') + + # Handle to which this cert was issued + conf = models.ForeignKey(Conf, related_name='certs') + + # The parent that issued the cert. This field is marked null=True because + # the root has no parent + parent = models.ForeignKey(Parent, related_name='certs', null=True) # certificate validity period not_before = models.DateTimeField() @@ -132,8 +137,11 @@ class ResourceCert(models.Model): uri = models.CharField(max_length=255) def __unicode__(self): - return u"%s's cert from %s" % (self.parent.issuer.handle, - self.parent.handle) + if self.parent: + return u"%s's cert from %s" % (self.conf.handle, + self.parent.handle) + else: + return u"%s's root cert" % self.conf.handle class ResourceRangeAddressV4(rpki.gui.models.PrefixV4): |