aboutsummaryrefslogtreecommitdiff
path: root/portal-gui/rpkigui/myrpki/models.py
diff options
context:
space:
mode:
authorBill Fenner <fenner@electricrain.com>2010-06-12 21:42:23 +0000
committerBill Fenner <fenner@electricrain.com>2010-06-12 21:42:23 +0000
commit854518eb039e1a259d8122c21bc696202a9d1a85 (patch)
treeda162392c934560cc984de9a560ea182ecc1351a /portal-gui/rpkigui/myrpki/models.py
parent5afc736808cf18baae5cfaab4a5e8b38da0032f9 (diff)
Add some comments so we don't have to work out from scratch why we
used M2M fields to associate resources with parents and children. svn path=/portal-gui/rpkigui/myrpki/models.py; revision=3286
Diffstat (limited to 'portal-gui/rpkigui/myrpki/models.py')
-rw-r--r--portal-gui/rpkigui/myrpki/models.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/portal-gui/rpkigui/myrpki/models.py b/portal-gui/rpkigui/myrpki/models.py
index a8b11a56..85e23228 100644
--- a/portal-gui/rpkigui/myrpki/models.py
+++ b/portal-gui/rpkigui/myrpki/models.py
@@ -61,6 +61,11 @@ class Child( models.Model ):
handle = HandleField()
validity = models.DateTimeField()
bpki_cert = models.ForeignKey( Cert, related_name='child_bpki' )
+ # It may seem strange that the address_range and asn fields
+ # are ManyToManyFields. Why not simply a ForeignKey from an Asn
+ # and an AddressRange? This is for transition. When a resource
+ # is moving from one child to another, we may have to be delegating
+ # it to both children at once.
address_range = models.ManyToManyField( AddressRange, blank=True )
asn = models.ManyToManyField( Asn, blank=True )
def __unicode__( self ):
@@ -77,6 +82,11 @@ class Parent( models.Model ):
https_bpki_cert = models.ForeignKey( Cert, related_name='parent_https' )
my_handle = HandleField()
sia_base = models.URLField( verify_exists=False )
+ # It may seem strange that the address_range and asn fields
+ # are ManyToManyFields. Why not simply a ForeignKey from an Asn
+ # and an AddressRange? This is for transition. When a resource
+ # is moving from one parent to another, we may be receiving the
+ # resource from both parents at once.
address_range = models.ManyToManyField( AddressRange,
related_name='from_parent' )
asn = models.ManyToManyField( Asn, related_name='from_parent' )