Removed workflow type as keyfield from program.
Patch by: Lennard de Rijk
Reviewed by: to-be-reviewed
--- a/app/soc/logic/models/organization.py Sat Jan 31 16:20:11 2009 +0000
+++ b/app/soc/logic/models/organization.py Sat Jan 31 17:01:56 2009 +0000
@@ -22,7 +22,6 @@
]
-from soc.logic.models import base
from soc.logic.models import group
from soc.logic.models import program as program_logic
@@ -42,10 +41,5 @@
super(Logic, self).__init__(model=model, base_model=base_model,
scope_logic=scope_logic)
- # Restore base.Logic key field related methods
- getKeyValuesFromEntity = base.Logic.getKeyValuesFromEntity
- getKeyValuesFromFields = base.Logic.getKeyValuesFromFields
- getKeyFieldNames = base.Logic.getKeyFieldNames
-
logic = Logic()
--- a/app/soc/logic/models/program.py Sat Jan 31 16:20:11 2009 +0000
+++ b/app/soc/logic/models/program.py Sat Jan 31 17:01:56 2009 +0000
@@ -45,24 +45,6 @@
super(Logic, self).__init__(model=model, base_model=base_model,
scope_logic=scope_logic)
-
- def getKeyValuesFromEntity(self, entity):
- """See base.Logic.getKeyNameValues.
- """
-
- return [entity.scope_path, entity.workflow, entity.link_id]
-
- def getKeyValuesFromFields(self, fields):
- """See base.Logic.getKeyValuesFromFields.
- """
-
- return [fields['scope_path'], fields['workflow'], fields['link_id']]
-
- def getKeyFieldNames(self):
- """See base.Logic.getKeyFieldNames.
- """
-
- return ['scope_path', 'workflow', 'link_id']
logic = Logic()
--- a/app/soc/logic/models/timeline.py Sat Jan 31 16:20:11 2009 +0000
+++ b/app/soc/logic/models/timeline.py Sat Jan 31 17:01:56 2009 +0000
@@ -23,28 +23,22 @@
from soc.logic.models import base
+from soc.logic.models import presence_with_tos as tos_logic
import soc.models.timeline
-
class Logic(base.Logic):
"""Logic methods for the Timeline model.
"""
def __init__(self, model=soc.models.timeline.Timeline,
- base_model=None, scope_logic=None):
+ base_model=None, scope_logic=tos_logic):
"""Defines the name, key_name and model for this entity.
"""
super(Logic, self).__init__(model=model, base_model=base_model,
scope_logic=scope_logic)
- def getScopeDepth(self):
- """See base.Logic.getScopeDepth.
- """
-
- return 3
-
def getKeyValuesFromEntity(self, entity):
"""See base.Logic.getKeyNameValues.
"""
--- a/app/soc/views/helper/access.py Sat Jan 31 16:20:11 2009 +0000
+++ b/app/soc/views/helper/access.py Sat Jan 31 17:01:56 2009 +0000
@@ -930,11 +930,10 @@
# timeline does not exists so deny
self.deny(django_args)
- splitkeyname = time_line_keyname.rsplit('/')
+ split_keyname = time_line_keyname.rsplit('/')
- fields = {'scope_path' : splitkeyname[0],
- 'workflow' : splitkeyname[1],
- 'link_id' : splitkeyname[2],
+ fields = {'scope_path' : split_keyname[0],
+ 'link_id' : split_keyname[1],
}
return self.checkIsHostForProgram(fields)