mirror of
https://github.com/RYGhub/royalnet.git
synced 2024-11-23 19:44:20 +00:00
Add table template
This commit is contained in:
parent
21ad1b7e73
commit
2c1f86719c
1 changed files with 14 additions and 0 deletions
14
pycharm_templates/table.vm
Normal file
14
pycharm_templates/table.vm
Normal file
|
@ -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)
|
||||||
|
|
||||||
|
...
|
Loading…
Reference in a new issue