Re: how to reference another function inside mode class

2006-02-03 Thread Adrian Holovaty
On 2/3/06, sam <[EMAIL PROTECTED]> wrote: > My bar() is a pure function defined outside all model classes but that > gave me the error. (If I defined it inside the same class from which it > was called, then it's OK). How do I deal with this? This is a bit of annoying magic Django currently does,

Re: how to reference another function inside mode class

2006-02-03 Thread sam
Amit, My bar() is a pure function defined outside all model classes but that gave me the error. (If I defined it inside the same class from which it was called, then it's OK). How do I deal with this? To import, what package path should I use? Sam

Re: how to reference another function inside mode class

2006-02-03 Thread Amit Upadhyay
On 2/3/06, sam <[EMAIL PROTECTED]> wrote: I was tring to write a custom function inside a mode class, say X:class X(meta.Model):i = meta.IntegerField()...def foo(self):return bar(self.i)If I define bar() in the same model file, django complained the "NameError -- global name bar