server/mirrormanager/controllers.py | 27 +++++++++++++++++++++++++++
1 file changed, 27 insertions(+)
New commits:
commit f0356370962eaa9dd8bac33c4b8b1c747a577725
Author: Matt Domsch <Matt_Domsch(a)dell.com>
Date: Mon Jun 20 22:51:20 2011 -0500
controllers: add NetblockCountry simple interface
diff --git a/server/mirrormanager/controllers.py b/server/mirrormanager/controllers.py
index 66c6c5b..d0f2ffb 100644
--- a/server/mirrormanager/controllers.py
+++ b/server/mirrormanager/controllers.py
@@ -1205,6 +1205,33 @@ class LocationHostController(controllers.Controller,
identity.SecureResource, co
raise redirect("/adminview")
+#########################################################3
+# NetblockCountry
+#########################################################3
+class NetblockCountryFields(widgets.WidgetsList):
+ netblock = widgets.TextField(validator=validators.All(validators.NotEmpty,
validators.UnicodeString))
+ country = widgets.TextField(validator=validators.All(validators.NotEmpty,
validators.UnicodeString))
+
+netblock_country_form = widgets.TableForm(fields=NetblockCountryFields(),
submit_text="Create Netblock->Country mapping")
+
+class NetblockCountryController(SimpleDbObjectController):
+ page_title = "Netblock to Country mapping"
+ myClass = NetblockCountry
+ url_prefix="netblock_country"
+ form = netblock_country_form
+
+ @expose(template="mirrormanager.templates.boringform")
+ @validate(form=form)
+ @error_handler(SimpleDbObjectController.new)
+ def create(self, **kwargs):
+ SimpleDbObjectController.create(self, **kwargs)
+
+ @expose(template="mirrormanager.templates.boringform")
+ @validate(form=form)
+ @error_handler()
+ def update(self, obj, **kwargs):
+ return SimpleDbObjectController.update(self, obj, **kwargs)
+
class Root(controllers.RootController):
# reserved for other uses outside TG
Show replies by date