Swap the order of request key fields
This will make it easier to remove scope_path as explicit key field
at some point by having it as inplicit key field for all entities.
Patch by: Sverre Rabbelier
--- a/app/soc/logic/models/request.py Sat Dec 06 11:53:26 2008 +0000
+++ b/app/soc/logic/models/request.py Sat Dec 06 12:12:58 2008 +0000
@@ -45,19 +45,19 @@
"""See base.Logic.getKeyNameValues.
"""
- return [entity.role, entity.scope.link_id, entity.link_id]
+ return [entity.scope.link_id, entity.role, entity.link_id]
def getKeyValuesFromFields(self, fields):
"""See base.Logic.getKeyValuesFromFields.
"""
- return [fields['role'], fields['scope_path'], fields['link_id']]
+ return [fields['scope_path'], fields['role'], fields['link_id']]
def getKeyFieldNames(self):
"""See base.Logic.getKeyFieldNames.
"""
- return ['role', 'scope_path', 'link_id']
+ return ['scope_path', 'role', 'link_id']
def _onCreate(self, entity):
"""Sends out a message notifying users about the new invite/request.
--- a/app/soc/views/helper/redirects.py Sat Dec 06 11:53:26 2008 +0000
+++ b/app/soc/views/helper/redirects.py Sat Dec 06 12:12:58 2008 +0000
@@ -27,7 +27,7 @@
"""
result ='/request/create/%s/%s/%s' % (
- params['url_name'], params['group_scope'], entity.key.name())
+ params['group_scope'], params['url_name'], entity.key().name())
return result