Steve Schmechel wrote: > I also toyed around with repoze.bfg.restcontroller from SVN. > > It works, but has it also been deprecated by new built-in functionality? > What are the advantages of using the rest controller vs. standard views?
Well, if you look at the implementation: http://svn.repoze.org/repoze.bfg.restcontroller/trunk/repoze/bfg/restcontroller/__init__.py (particularly the "restcontroller" function in that module) ... you will see that it's a tiny little shim on top of functionality that exists in the BFG core. That package was more of a proof of concept and an example of creating a ZCML directive than something that I'd expect anyone to get real excited about. You could do the same thing with "view" statements, just more verbosely: <view name="myview" view=".some.Class" attr="GET" request_method="POST" /> <view name="myview" view=".some.Class" attr="POST" request_method="POST" /> .. and so on. - C > > > Thanks, > Steve > > --- On Thu, 1/21/10, Chris McDonough <chr...@plope.com> wrote: > >> From: Chris McDonough <chr...@plope.com> >> Subject: Re: [Repoze-dev] Trouble with repoze.bfg.restrequest >> To: "Steve Schmechel" <steveschmec...@yahoo.com> >> Cc: repoze-dev@lists.repoze.org >> Date: Thursday, January 21, 2010, 2:48 PM >> r.b.restrequest is no longer >> supported or required. >> >> Instead use the built-in BFG "request_method" feature: >> >> <view >> view=".my.get_view" >> request_method="GET"/> >> >> <view >> view=".my.post_view" >> request_method="POST"/> >> >> See also the other "predicates" of the view directive: >> >> http://docs.repoze.org/bfg/1.2/zcml/view.html#predicate-attributes >> >> >> >> Steve Schmechel wrote: >>> I am trying out repoze.bfg.restrequest and having a >> little trouble getting it to run in a bfg_starter project >> following the documentation at: >>> http://pypi.python.org/pypi/repoze.bfg.restrequest/1.0.1 >>> >>> (I am running version 1.2a10 on Python 2.5 in a >> virtual environment with the --no-site-packages option on >> Windows) >>> When I add the required include statement to >> configure.zcml: >>> <include >> package="repoze.bfg.restrequest" /> >>> I get the following error: >>> >>> No such file or directory: >> 'C:\\WebService\\bfgRest\\lib\\site-packages\\repoze.bfg.restrequest-1.0.1-py2.5.egg\\repoze\\bfg\\restrequest\\configure.zcml' >>> The egg is installed and the project "developed" with >> it. >>> There is, in fact no configure.zcml file at that >> spot. >>> Shouldn't it include something? Did that maybe >> not get uploaded in the tarball to PyPI? >>> Thanks for any help, >>> Steve >>> >>> >>> >> _______________________________________________ >>> Repoze-dev mailing list >>> Repoze-dev@lists.repoze.org >>> http://lists.repoze.org/listinfo/repoze-dev >>> >> > > > > _______________________________________________ Repoze-dev mailing list Repoze-dev@lists.repoze.org http://lists.repoze.org/listinfo/repoze-dev