From 2c1f86719c1f087b12fcb33ef0915fa41594188c Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Thu, 30 Jan 2020 19:37:23 +0100 Subject: [PATCH] Add table template --- pycharm_templates/table.vm | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 pycharm_templates/table.vm diff --git a/pycharm_templates/table.vm b/pycharm_templates/table.vm new file mode 100644 index 00000000..c6134933 --- /dev/null +++ b/pycharm_templates/table.vm @@ -0,0 +1,14 @@ +from sqlalchemy import * +from sqlalchemy.orm import * +from sqlalchemy.ext.declarative import declared_attr + + +#set($CAPITALIZED_NAME = $NAME.substring(0,1).toUpperCase() + $NAME.substring(1)) +class ${CAPITALIZED_NAME}: + __tablename__ = "${NAME}" + + @declared_attr + def id(self): + return Column(Integer, primary_key=True) + + ...