Re: [Repoze-dev] Can I set an HTTP METHOD in View Configuration ?

2010-03-18 Thread Chris McDonough
You can't specify more than one method per view tag, but this will work:

  view
context=.models.Hello
view=.views.hello_world
name=hello.html
request_method=GET
/

  view
context=.models.Hello
view=.views.hello_world
name=hello.html
request_method=POST
/

(the above register two view configurations for the same view callable, which 
will do what you want)

- C


On 3/18/10 9:51 AM, Stéphane Klein wrote:
 Hi,

 I would like do something like that in View Configuration via ZCML :

 view
   context=.models.Hello
   view=.views.hello_world
   name=hello.html
   method=GET,POST
   /

 I don't want execute this view if request method is DELETE, OPTIONS…

 If this feature not exists, can I create a bug report and maybe an patch
 to support it ?

 Thanks for your help,
 Regards,
 Stephane

 ___
 Repoze-dev mailing list
 Repoze-dev@lists.repoze.org
 http://lists.repoze.org/listinfo/repoze-dev



-- 
Chris McDonough
Agendaless Consulting, Fredericksburg VA
The repoze.bfg Web Application Framework Book: http://bfg.repoze.org/book
___
Repoze-dev mailing list
Repoze-dev@lists.repoze.org
http://lists.repoze.org/listinfo/repoze-dev


Re: [Repoze-dev] Can I set an HTTP METHOD in View Configuration ?

2010-03-18 Thread Stéphane Klein
Le 18/03/2010 14:51, Stéphane Klein a écrit :
 Hi,

 I would like do something like that in View Configuration via ZCML :

 view
   context=.models.Hello
   view=.views.hello_world
   name=hello.html
   method=GET,POST
   /

 I don't want execute this view if request method is DELETE, OPTIONS…

This feature exist : it is request_method.

http://docs.repoze.org/bfg/current/narr/views.html

Regards,
Stephane

___
Repoze-dev mailing list
Repoze-dev@lists.repoze.org
http://lists.repoze.org/listinfo/repoze-dev


Re: [Repoze-dev] Can I set an HTTP METHOD in View Configuration ?

2010-03-18 Thread Stéphane Klein
Le 18/03/2010 14:51, Stéphane Klein a écrit :
 Hi,

 I would like do something like that in View Configuration via ZCML :

 view
   context=.models.Hello
   view=.views.hello_world
   name=hello.html
   method=GET,POST
   /

 I don't want execute this view if request method is DELETE, OPTIONS…

This feature exist : it is request_method.

http://docs.repoze.org/bfg/current/narr/views.html

Regards,
Stephane

___
Repoze-dev mailing list
Repoze-dev@lists.repoze.org
http://lists.repoze.org/listinfo/repoze-dev