[Zope3-Users] Re: Getting URL?para=val in view class

Florian Lindner mailinglists at xgm.de
Sun Dec 5 14:54:51 EST 2004


jürgen Kartnaller schrieb:
> Florian Lindner wrote:
> 
>> Hello,
>> I have a number of slightly different views for a class. All are 
>> almost the same and repreent a folder listing. One view are all object 
>> with the objects where owner==logged in user, another view are all 
>> objects on which the logged user has a certain permission.
>> Instead of different view a planned to use on template with a view 
>> class and access the view with view.html?view=MyObjects or 
>> view.html?view=AssigendObjects. The view class get this parameter and 
>> generates a list with the objects. The template renders this list.
>>
>> My questions:
>> How would you do that? What is the Zope way?
>> And how to get the ?view parameter in the view class?
> 
> 
> I did exactly the same for a memberlist :
> 
> In my view class I have a method 'selectMembers'.
> I call my view from a form with all the necessary parameters.
> 
> In the 'selectMembers' method I get the parameters from the request like
> filterNames=self.request.get('filterNames',None)

And this function return a list of members.

So you use in your template:

<li tal:repeat="member view/selectMembers">
   <span tal:replace="member/name" />
</li>

Correct?

Florian



More information about the Zope3-users mailing list