swingmusic/app/utils/decorators.py
mungai-njoroge 93de3d2f0c rewrite migrations
+ delete older migrations ... oops
+ change migratrions from "migrations" to "dbmigrations"
+ restructure migrations, order them based on release version
+ add a utils/decorators.py file with a coroutine decorator
2023-07-29 06:46:28 +03:00

12 lines
217 B
Python

def coroutine(func):
"""
Decorator: primes `func` by advancing to first `yield`
"""
def start(*args, **kwargs):
cr = func(*args, **kwargs)
next(cr)
return cr
return start