From: smbaker Date: Wed, 24 Jul 2013 22:56:24 +0000 (-0700) Subject: added some comments X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=7c79d35c62d731d5fe21a65edacffee211fe8557;p=plstackapi.git added some comments --- diff --git a/planetstack/core/admin.py b/planetstack/core/admin.py index c7e3821..bfd9421 100644 --- a/planetstack/core/admin.py +++ b/planetstack/core/admin.py @@ -41,7 +41,9 @@ class TagInline(generic.GenericTabularInline): extra = 1 class NetworkLookerUpper: - """ This is a callable that looks up a network name in a sliver """ + """ This is a callable that looks up a network name in a sliver and returns + the ip address for that network. + """ def __init__(self, name): self.short_description = name @@ -72,6 +74,9 @@ class SliverInline(PlStackTabularInline): def get_readonly_fields(self, request, obj=None): readonly_fields = super(SliverInline, self).get_readonly_fields(request, obj) + # Lookup the networks that are bound to the slivers, and add those + # network names to the list of readonly fields. + for sliver in obj.slivers.all(): for nbs in sliver.networkboundsliver_set.all(): if nbs.ip is not None: