Add missing TODOs to soc.logic.models classes. Fix comments format in base.Logic class. Changes based on comments to r972.
http://code.google.com/p/soc/source/detail?r=972
Patch by: Pawel Solyga
--- a/app/soc/logic/models/base.py Sun Nov 02 22:57:46 2008 +0000
+++ b/app/soc/logic/models/base.py Mon Nov 03 15:03:09 2008 +0000
@@ -51,34 +51,33 @@
return True
def _keyName(self, **kwargs):
- """
- Returns the KeyName constructed from kwargs for this type of entity
+ """Returns the KeyName constructed from kwargs for this type of entity
- The Keyname is in the following format:
+ The KeyName is in the following format:
entity.name:<key_value1>:<key_value2>:...:<key_valueN>
"""
- #Get the KeyFieldNames for this entity
+ # get the KeyFieldNames for this entity
key_field_names = self.getKeyFieldNames()
- #Check if all given KeyFieldNames are valid for this entity
+ # check if all given KeyFieldNames are valid for this entity
if not all(key in key_field_names for key in kwargs.keys()):
raise Error("Some of the provided arguments are not key fields")
- #Check if all key_field_names for this entity are present in kwargs
+ # check if all key_field_names for this entity are present in kwargs
if not all(field in kwargs.keys() for field in key_field_names):
raise Error("Not all the required key fields are present")
- #Check if all kwargs.values() are non-false
+ # check if all kwargs.values() are non-false
if not all(kwargs.values()):
raise Error("Not all KeyValues are non-false")
- #Construct the KeyValues in the order given by getKeyFieldNames()
+ # construct the KeyValues in the order given by getKeyFieldNames()
keyvalues = []
for key_field_name in key_field_names:
keyvalues.append(kwargs[key_field_name])
- #Construct the KeyName in the appropriate format
+ # construct the KeyName in the appropriate format
return ":".join([self._name] + keyvalues)
def getKeyValues(self, entity):
--- a/app/soc/logic/models/home_settings.py Sun Nov 02 22:57:46 2008 +0000
+++ b/app/soc/logic/models/home_settings.py Mon Nov 03 15:03:09 2008 +0000
@@ -38,6 +38,8 @@
self._name = "HomeSettings"
self._model = soc.models.home_settings.HomeSettings
+ # TODO: remove line below when HomeSettings is implemented using
+ # views.models.base.View approach
self._keyName = key_name.nameHomeSettings
self._skip_properties = []
--- a/app/soc/logic/models/site_settings.py Sun Nov 02 22:57:46 2008 +0000
+++ b/app/soc/logic/models/site_settings.py Mon Nov 03 15:03:09 2008 +0000
@@ -41,6 +41,8 @@
self._name = "SiteSettings"
self._model = soc.models.site_settings.SiteSettings
+ # TODO: remove line below when SiteSettings is implemented using
+ # views.models.base.View approach
self._keyName = key_name.nameSiteSettings
self._skip_properties = []
--- a/app/soc/logic/models/work.py Sun Nov 02 22:57:46 2008 +0000
+++ b/app/soc/logic/models/work.py Mon Nov 03 15:03:09 2008 +0000
@@ -38,9 +38,11 @@
self._name = "Work"
self._model = soc.models.work.Work
+ # TODO: remove line below when Work is implemented using
+ # views.models.base.View approach
self._keyName = key_name.nameWork
self._skip_properties = []
- # TODO(tlarsen) write a nameWork method
+ # TODO(tlarsen): write a nameWork method
logic = Logic()