app/soc/views/models/role.py
changeset 660 5a381b290691
parent 657 c781de4f6d39
child 663 c2dcae606699
equal deleted inserted replaced
659:23ef8f62d7cb 660:5a381b290691
    78 
    78 
    79     Args:
    79     Args:
    80       params: This dictionary should be filled with the parameters
    80       params: This dictionary should be filled with the parameters
    81     """
    81     """
    82 
    82 
       
    83     new_params = {}
       
    84 
       
    85     patterns = [(r'^%(url_name)s/invite/%(lnp)s$',
       
    86         'soc.views.models.%(module_name)s.invite',
       
    87         'Invite %(name_short)s')]
       
    88 
       
    89     new_params['extra_django_patterns'] = patterns
       
    90 
       
    91     params = dicts.merge(params, new_params)
       
    92 
    83     super(View, self).__init__(params=params)
    93     super(View, self).__init__(params=params)
    84 
    94 
    85   def create(self, request, **kwargs):
    95   def create(self, request, **kwargs):
    86     """Specialized create view to enforce needing a scope_path
    96     """Specialized create view to enforce needing a scope_path
    87 
    97 
   127 
   137 
   128     content = helper.lists.getListContent(request, params)
   138     content = helper.lists.getListContent(request, params)
   129     contents = [content]
   139     contents = [content]
   130 
   140 
   131     return self._list(request, params, contents, page_name)
   141     return self._list(request, params, contents, page_name)
   132 
       
   133   def getDjangoURLPatterns(self, params=None):
       
   134     """See base.View.getDjangoURLPatterns().
       
   135     """
       
   136 
       
   137     default_patterns = self._params['django_patterns_defaults']
       
   138     default_patterns += [
       
   139         (r'^%(url_name)s/invite/%(lnp)s$',
       
   140             'soc.views.models.%s.invite', 'Invite %(name_short)s')]
       
   141 
       
   142     params = {}
       
   143     params['django_patterns_defaults'] = default_patterns
       
   144 
       
   145     params = dicts.merge(params, self._params)
       
   146     patterns = super(View, self).getDjangoURLPatterns(params)
       
   147 
       
   148     return patterns
       
   149