From 7c79d35c62d731d5fe21a65edacffee211fe8557 Mon Sep 17 00:00:00 2001 From: smbaker Date: Wed, 24 Jul 2013 15:56:24 -0700 Subject: [PATCH] added some comments --- planetstack/core/admin.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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: -- 2.47.0