Tim Hoffman wrote:
> Hi Chris
> 
> I am trying to register some views directly through python and not
> using the view decorator,
> I have tried using code very similiar to repoze.bfg.testing.
> 
> However after doing so, whilst I can look the view up by doing
> a zope.component.queryMultiAdapter((context,request),IView,name="myview")
> and alternately getting the site manager first.
> 
> However the router never seems to be able to find the views I have
> registered in this fashion.

Sorry for not responding sooner Tim.

I'm not sure how this is; it may be that your registrations are getting in to 
the "wrong" registry.  Try using repoze.bfg.threadlocal.get_current_registry() 
instead of zope.component.getSiteManager() to retrieve the registry before you 
add stuff to it maybe?

Note that the trunk has facilities out of the box for this (although it's still 
under heavy development):

<http://docs.repoze.org/bfg/trunk/narr/configuration.html#hello-world-configured-imperatively>


- C

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

Reply via email to