Add YASnippets for Flask-SQLAlchemy models
…both normal and translatable
This commit is contained in:
14
snippets/python-mode/translatable_model
Normal file
14
snippets/python-mode/translatable_model
Normal file
@@ -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
|
Reference in New Issue
Block a user