Re: adding a static class to another class

2007-09-18 Thread Bruno Desthuilliers
Nathan Harmston a écrit : > Hi, > > I guess my description was a bit rubbish in retrospec, I dont even > think the title of my email made senseit doesnt to me now: > > class Manager(object): > def __init__(self): > pass > def dosomething(self): > return "RESULTS" > > class Foo(ob

Re: adding a static class to another class

2007-09-17 Thread Nathan Harmston
Hi, I guess my description was a bit rubbish in retrospec, I dont even think the title of my email made senseit doesnt to me now: class Manager(object): def __init__(self): pass def dosomething(self): return "RESULTS" class Foo(object): def __init__(self): self.a = "NEE" W

Re: adding a static class to another class

2007-09-17 Thread Bruno Desthuilliers
Nathan Harmston a écrit : > HI, > > I m trying to start an api in a similar way to the djangic way of > Class.objects.all(). Ie objects is a "Manager" class. > > So: > > class Foo(object): >def __init__(self): > self.test = "NEE" > > class Manager(object): > def __init__(self):

Re: adding a static class to another class

2007-09-17 Thread James Stroud
James Stroud wrote: > Nathan Harmston wrote: >> And also preventing more than one Manager instance instantiated at one >> time. > > Forgot to answer this. You want the singleton pattern: > > http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/52558 But not really a singleton now that I think

Re: adding a static class to another class

2007-09-16 Thread James Stroud
Nathan Harmston wrote: > And also preventing more than one Manager instance instantiated at one > time. Forgot to answer this. You want the singleton pattern: http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/52558 James -- http://mail.python.org/mailman/listinfo/python-list

Re: adding a static class to another class

2007-09-16 Thread James Stroud
Nathan Harmston wrote: > HI, > > I m trying to start an api in a similar way to the djangic way of > Class.objects.all(). Ie objects is a "Manager" class. > > So: > > class Foo(object): >def __init__(self): > self.test = "NEE" > > class Manager(object): > def __init__(self): >

Re: adding a static class to another class

2007-09-16 Thread thebjorn
On Sep 17, 1:14 am, "Nathan Harmston" <[EMAIL PROTECTED]> wrote: > HI, > > I m trying to start an api in a similar way to the djangic way of > Class.objects.all(). Ie objects is a "Manager" class. > > So: > > class Foo(object): >def __init__(self): > self.test = "NEE" > > class Manager(

adding a static class to another class

2007-09-16 Thread Nathan Harmston
HI, I m trying to start an api in a similar way to the djangic way of Class.objects.all(). Ie objects is a "Manager" class. So: class Foo(object): def __init__(self): self.test = "NEE" class Manager(object): def __init__(self): pass def all(self): return "COCONU