def new(cls, data, status='pending', **options): options.setdefault('path', getattr(g, 'path', None)) state = TaskState.make(dict( type=cls.name, status=status, options=options, data=data)) state.m.insert() return cls(state)
def new(cls, data, status='pending', **options): state = TaskState.make( dict(type=cls.name, status=status, options=options, data=data)) state.m.insert() return cls(state)
def new(cls, data, status='pending', **options): options.setdefault('path', getattr(g, 'path', None)) state = TaskState.make( dict(type=cls.name, status=status, options=options, data=data)) state.m.insert() return cls(state)
def new(cls, data, status="pending", **options): state = TaskState.make(dict(type=cls.name, status=status, options=options, data=data)) state.m.insert() return cls(state)