Move TODO about isDeletable Sponsor logic method to sponsor.py module and extend a little bit doc string.
Patch by: Pawel Solyga
Review by: to-be-reviewed
--- a/app/soc/logic/models/base.py Fri Oct 17 12:52:02 2008 +0000
+++ b/app/soc/logic/models/base.py Fri Oct 17 13:04:51 2008 +0000
@@ -208,7 +208,7 @@
return self.updateModelProperties(entity, **properties)
def updateOrCreateFromFields(self, properties, **kwargs):
- """Like updateOrCreateFromKeyName, but resolves **kwargs to a key_name first
+ """Like updateOrCreateFromKeyName, but resolves **kwargs to a key_name first.
"""
# attempt to retrieve the existing entity
@@ -217,11 +217,12 @@
return self.updateOrCreateFromKeyName(properties, key_name)
def isDeletable(self, entity):
- """Returns whether the specified entity can be deleted
+ """Returns whether the specified entity can be deleted.
+
+ Args:
+ entity: an existing entity in datastore
"""
-
- # TODO(pawel.solyga): Create specific delete method for Sponsor model
- # Check if Sponsor can be deleted (has no Hosts and Programs)
+
return True
def delete(self, entity):
--- a/app/soc/logic/models/sponsor.py Fri Oct 17 12:52:02 2008 +0000
+++ b/app/soc/logic/models/sponsor.py Fri Oct 17 13:04:51 2008 +0000
@@ -41,5 +41,13 @@
self._keyName = key_name.nameSponsor
self._skip_properties = []
+ def isDeletable(self, entity):
+ """Returns whether the specified Sponsor entity can be deleted.
+
+ Args:
+ entity: an existing Sponsor entity in datastore
+ """
+ # TODO(pawel.solyga): Check if Sponsor can be deleted (no Hosts, Programs)
+ return True
logic = Logic()