Made _logic a param
The _logic parameter is added in base.py to make this as small and
non-intrustive change.
Patch by: Sverre Rabbelier
--- a/app/soc/views/models/base.py Fri Nov 28 23:08:14 2008 +0000
+++ b/app/soc/views/models/base.py Sat Nov 29 00:12:16 2008 +0000
@@ -164,6 +164,7 @@
}
self._params = dicts.merge(params, new_params)
+ self._logic = self._params['logic']
def public(self, request, page_name=None, params=None, **kwargs):
"""Displays the public page for the entity specified by **kwargs.
--- a/app/soc/views/models/document.py Fri Nov 28 23:08:14 2008 +0000
+++ b/app/soc/views/models/document.py Sat Nov 29 00:12:16 2008 +0000
@@ -92,9 +92,8 @@
original_params: a dict with params for this View
"""
- self._logic = soc.logic.models.document.logic
-
params = {}
+ params['logic'] = soc.logic.models.document.logic
params['name'] = "Document"
params['name_short'] = "Document"
--- a/app/soc/views/models/host.py Fri Nov 28 23:08:14 2008 +0000
+++ b/app/soc/views/models/host.py Sat Nov 29 00:12:16 2008 +0000
@@ -87,9 +87,8 @@
original_params: a dict with params for this View
"""
- self._logic = soc.logic.models.host.logic
-
params = {}
+ params['logic'] = soc.logic.models.host.logic
params['logic'] = soc.logic.models.host.logic
params['group_view'] = soc.views.models.sponsor.view
--- a/app/soc/views/models/presence.py Fri Nov 28 23:08:14 2008 +0000
+++ b/app/soc/views/models/presence.py Sat Nov 29 00:12:16 2008 +0000
@@ -108,6 +108,7 @@
"""
params = {}
+ params['logic'] = soc.logic.models.presence.logic
params['name'] = "Home Settings"
params['name_short'] = "Home Settings"
@@ -125,8 +126,6 @@
base.View.__init__(self, params=params)
- self._logic = soc.logic.models.presence.logic
-
def _public(self, request, entity, context):
"""
"""
--- a/app/soc/views/models/request.py Fri Nov 28 23:08:14 2008 +0000
+++ b/app/soc/views/models/request.py Sat Nov 29 00:12:16 2008 +0000
@@ -99,13 +99,12 @@
original_params: a dict with params for this View
"""
- self._logic = soc.logic.models.request.logic
-
rights = {}
rights['listSelf'] = [access.checkIsUser]
params = {}
params['rights'] = rights
+ params['logic'] = soc.logic.models.request.logic
params['name'] = "Request"
params['name_short'] = "Request"
--- a/app/soc/views/models/site.py Fri Nov 28 23:08:14 2008 +0000
+++ b/app/soc/views/models/site.py Sat Nov 29 00:12:16 2008 +0000
@@ -80,6 +80,7 @@
"""
params = {}
+ params['logic'] = soc.logic.models.site.logic
# TODO(alturin): add ugettext_lazy ?
params['name'] = "Site Settings"
@@ -107,8 +108,6 @@
presence.View.__init__(self, original_params=params)
- self._logic = soc.logic.models.site.logic
-
def mainPublic(self, request, page_name=None, **kwargs):
"""Displays the main site settings page.
--- a/app/soc/views/models/sponsor.py Fri Nov 28 23:08:14 2008 +0000
+++ b/app/soc/views/models/sponsor.py Sat Nov 29 00:12:16 2008 +0000
@@ -78,9 +78,8 @@
original_params: a dict with params for this View
"""
- self._logic = soc.logic.models.sponsor.logic
-
params = {}
+ params['logic'] = soc.logic.models.sponsor.logic
params['name'] = "Sponsor"
params['name_short'] = "Sponsor"
--- a/app/soc/views/models/user.py Fri Nov 28 23:08:14 2008 +0000
+++ b/app/soc/views/models/user.py Sat Nov 29 00:12:16 2008 +0000
@@ -123,9 +123,8 @@
original_params: a dict with params for this View
"""
- self._logic = soc.logic.models.user.logic
-
params = {}
+ params['logic'] = soc.logic.models.user.logic
params['name'] = "User"
params['name_short'] = "User"
--- a/app/soc/views/models/user_self.py Fri Nov 28 23:08:14 2008 +0000
+++ b/app/soc/views/models/user_self.py Sat Nov 29 00:12:16 2008 +0000
@@ -94,8 +94,6 @@
original_params: a dict with params for this View
"""
- self._logic = soc.logic.models.user.logic
-
rights = {}
rights['unspecified'] = [access.deny]
rights['any_access'] = [access.allow]
@@ -105,6 +103,7 @@
params = {}
params['rights'] = rights
+ params['logic'] = soc.logic.models.user.logic
params['name'] = "User"
params['name_short'] = "User"