Add YASnippets for Flask-SQLAlchemy models

…both normal and translatable
master
Gergely Polonkai 5 years ago
parent 620bc853f7
commit bbcabf3c74

@ -0,0 +1,10 @@
# -*- mode: snippet -*-
# name: flask_sqlalchemy_model
# key: model
# --
class ${1:name}(db.Model):
__tablename__ = '${2:tablename}'
id = db.Column(db.Integer, primary_key=True)
$0

@ -0,0 +1,14 @@
# -*- mode: snippet -*-
# name: Translatable Flask-SQLAlchemy model
# key: tmodel
# --
class ${1:name}(Translatable, db.Model):
__tablename__ = '${2:tablename}s'
id = db.Column(db.Integer, primary_key=True)
class $1Translation(translation_base($1)):
__tablename__ = '$2_translations'
$0
Loading…
Cancel
Save