@classmethod<EOL><INDENT>def scope(cls, f):<DEDENT>
if not hasattr(cls, "<STR_LIT>"):<EOL><INDENT>cls.scopes = copy(STANDARD_SCOPES)<EOL><DEDENT>cls.scopes.append(f)<EOL>def create_builder(self, *args, **kwargs):<EOL><INDENT>bldr = ScopeBuilder(cls, cls.scopes)<EOL>return getattr(bldr, f.__name__)(*args, **kwargs)<EOL><DEDENT>setattr(cls, f.__name__, classmethod(create_builder))<EOL>return f<EOL>
Decorator which can dynamically attach a query scope to the model.