# HG changeset patch # User Pawel Solyga # Date 1225724589 0 # Node ID f3c313d54aa41e0741e2c83accc8023df11ab990 # Parent 829fe8302a8bbf7b0007178e3084e92a4a234807 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 diff -r 829fe8302a8b -r f3c313d54aa4 app/soc/logic/models/base.py --- 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:::...: """ - #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): diff -r 829fe8302a8b -r f3c313d54aa4 app/soc/logic/models/home_settings.py --- 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 = [] diff -r 829fe8302a8b -r f3c313d54aa4 app/soc/logic/models/site_settings.py --- 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 = [] diff -r 829fe8302a8b -r f3c313d54aa4 app/soc/logic/models/work.py --- 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()