models.py 308 Bytes
Newer Older
1 2
from ..models import method_cache

Őry Máté committed
3

4 5 6 7 8 9 10 11 12 13 14 15
class TestClass(object):
    id = None
    called = 0

    def __init__(self, id):
        self.id = id

    @method_cache()
    def method(self, s):
        # print 'Called TestClass(%d).method(%s)' % (self.id, s)
        self.called += 1
        return self.id + len(s)