[Repoze-dev] would like to registerViews in python but not via decorator

2009-11-23 Thread Tim Hoffman
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.

If I have a look in the registry (pdb'ing repoze.bfg.router) I can see
the registrations in _adapter_registrations
however loopkup() never seems to find them.

Is there some additional strange incantation that I am missing , or
got any alternate suggestions for approachs.

I am trying to defer my startup costs under app engine, and a whole
lot of zcml is not required to be processed depending on the type of
user.
That seems to hard to defer, so moving to explicit python
registrations seems to be the better approach, and works for anything
directly looked up via getMutliAdapter.

Thanks

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


Re: [Repoze-dev] doc question

2009-11-23 Thread Chris Rossi
On Sun, Nov 22, 2009 at 9:08 PM, Chris McDonough chr...@plope.com wrote:

 Iain Duncan wrote:
  Am I missing something terribly obvious, or is that not just a regular
  instance method in the example? Or am I misunderstanding the point?
  Perhaps this part could be clearer, it's confused me at any rate.

 I'm not really clear how to make changes to make it clearer.  What are your
 expectations?

 This seems to be a simple confusion over terminology.  According Python's
own terminology, the following class has a class method, a static method,
and an instance method:


class C(Object):
@classmethod
def factory(cls, *args, **kw):
My first argument is the class.

@staticmethod
def something_else(*args, **kw):
I get no special args.

def an_instance_method(self, *args, **kw):
I take an instance as my first arg.

So, technically, where the documentation refers to a class method, you
really mean an instance method.

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


Re: [Repoze-dev] doc question

2009-11-23 Thread Iain Duncan
On Mon, 2009-11-23 at 09:37 -0500, Chris Rossi wrote:
 
 
 On Sun, Nov 22, 2009 at 9:08 PM, Chris McDonough chr...@plope.com
 wrote:
 Iain Duncan wrote:
  Am I missing something terribly obvious, or is that not just
 a regular
  instance method in the example? Or am I misunderstanding the
 point?
  Perhaps this part could be clearer, it's confused me at any
 rate.
 
 
 I'm not really clear how to make changes to make it clearer.
  What are your
 expectations?
 
 This seems to be a simple confusion over terminology.  According
 Python's own terminology, the following class has a class method, a
 static method, and an instance method:
 
 
 class C(Object):
 @classmethod 
 def factory(cls, *args, **kw):
 My first argument is the class.
 
 @staticmethod
 def something_else(*args, **kw):
 I get no special args.
   
 def an_instance_method(self, *args, **kw):
 I take an instance as my first arg.
 
 So, technically, where the documentation refers to a class method, you
 really mean an instance method.

That was indeed what I meant. I was looking for the *class method* and
wondering if there was a typo or something.

Iain


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


Re: [Repoze-dev] mailing list split?

2009-11-23 Thread Carlos de la Guardia
Ok, let's pile on. +1.

Carlos de la Guardia

On Sun, Nov 22, 2009 at 6:28 PM, Iain Duncan iaindun...@telus.net wrote:
 Hey folks, just floating the idea of splitting the issue tracker
 mailouts on to their own mailing list? In my experience on this and
 other lists, it's a lot more pleasant to read the mailing list without
 having to scroll through the issue tracking comments. Just a thought.

 Iain

 ___
 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