Skip to content

Instantly share code, notes, and snippets.

View mvaldes14's full-sized avatar

Miguel Valdes mvaldes14

View GitHub Profile
@doobeh
doobeh / sqlalchemy-cheatsheet.py
Last active September 30, 2020 15:36
sqlalchemy-cheatsheet from http://ergo.io/sqlalchemy-cheatsheet.html tutorial
from flask import Flask
from flask.ext.sqlalchemy import SQLAlchemy
app = Flask(__name__)
db = SQLAlchemy(app)
class Author(db.Model):
id = db.Column(db.Integer, primary_key=True)
name = db.Column(db.Text)
import asyncio
loop = asyncio.get_event_loop()
async def hello():
await asyncio.sleep(3)
print('Hello!')
if __name__ == '__main__':
loop.run_until_complete(hello())