Re: [Repoze-dev] multiple views for routes context in bfg
On 5/19/09 10:44 PM, Chris McDonough wrote: > On 5/19/09 10:05 PM, Stephan Altmueller wrote: >> Hi, >> >> I might be missing something, but it seems that in bfg 0.8 every >> routes context can only have one view associated with it. >> >> In 0.7.1 you could have something like this >> >> > name="itemview" >> view=".views.item_view" /> >> >> > name="itemview" >> view=".views.POST_item_view" >> request_type="repoze.bfg.interfaces.IPOSTRequest" /> >> >> > factory=".models.get_item_context" >> view_name="itemview" /> >> >> >> Note this applies also to custom request types not just POST, PUT etc. >> >> I thought this was a very useful feature that provided a very compact >> way to build custom views for different clients (REST client, mobile >> devices, JSON clients etc.). > > You can get the same in 0.8 from: > > factory=".models.get_item_context" > view=".views.POST_itemview" > condition_method="POST"/> > > factory=".models.get_item_context" > view=".views.item_view" > condition_method="GET"/> Oops, I forgot name= in each of those: - C ___ Repoze-dev mailing list Repoze-dev@lists.repoze.org http://lists.repoze.org/listinfo/repoze-dev
Re: [Repoze-dev] multiple views for routes context in bfg
On 5/19/09 10:05 PM, Stephan Altmueller wrote: > Hi, > > I might be missing something, but it seems that in bfg 0.8 every > routes context can only have one view associated with it. > > In 0.7.1 you could have something like this > > name="itemview" >view=".views.item_view" /> > > name="itemview" >view=".views.POST_item_view" >request_type="repoze.bfg.interfaces.IPOSTRequest" /> > > factory=".models.get_item_context" > view_name="itemview" /> > > > Note this applies also to custom request types not just POST, PUT etc. > > I thought this was a very useful feature that provided a very compact > way to build custom views for different clients (REST client, mobile > devices, JSON clients etc.). You can get the same in 0.8 from: - C > > Thanks. > >-- Stephan Altmueller > > ___ > 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
[Repoze-dev] multiple views for routes context in bfg
Hi, I might be missing something, but it seems that in bfg 0.8 every routes context can only have one view associated with it. In 0.7.1 you could have something like this Note this applies also to custom request types not just POST, PUT etc. I thought this was a very useful feature that provided a very compact way to build custom views for different clients (REST client, mobile devices, JSON clients etc.). Thanks. -- Stephan Altmueller ___ Repoze-dev mailing list Repoze-dev@lists.repoze.org http://lists.repoze.org/listinfo/repoze-dev