I\'m using Python 3. I know about the @classmethod decorator. Also, I know that classmethods can be called from instances.
class HappyClass(object): @classme
How I achieved it:
@classmethod def search_url(cls): if not hasattr(cls, '_search_url'): setattr(cls, '_search_url', reverse('%s-search' % cls._meta.model_name)) return cls._search_url