diff options
| author | Jules Laplace <julescarbon@gmail.com> | 2020-09-30 18:48:54 +0200 |
|---|---|---|
| committer | Jules Laplace <julescarbon@gmail.com> | 2020-09-30 18:48:54 +0200 |
| commit | 9dba744407f61a56efb8e63bbfa50ade6e847acf (patch) | |
| tree | e3953fcceafa010bdc7a4df353c74fe571c9c13d /animism-align/cli/app/sql/models/venue.py | |
| parent | 58b47df64f1ec0444a45892c1db2ca195ec93deb (diff) | |
update episodes table form. add venues table and CRUD
Diffstat (limited to 'animism-align/cli/app/sql/models/venue.py')
| -rw-r--r-- | animism-align/cli/app/sql/models/venue.py | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/animism-align/cli/app/sql/models/venue.py b/animism-align/cli/app/sql/models/venue.py new file mode 100644 index 0000000..992adea --- /dev/null +++ b/animism-align/cli/app/sql/models/venue.py @@ -0,0 +1,32 @@ +from sqlalchemy import create_engine, Table, Column, Text, String, Integer, Boolean, Float, DateTime, JSON, ForeignKey +from sqlalchemy.orm import relationship +import sqlalchemy.sql.functions as func +from sqlalchemy_utc import UtcDateTime, utcnow +from wtforms_alchemy import ModelForm + +from app.sql.common import db, Base, Session + +from app.settings import app_cfg + +class Venue(Base): + """Table for storing the venue list""" + __tablename__ = 'venue' + id = Column(Integer, primary_key=True) + title = Column(String(256, convert_unicode=True), nullable=False) + date = Column(String(256, convert_unicode=True), nullable=False) + settings = Column(JSON, default={}, nullable=True) + + def toJSON(self): + return { + 'id': self.id, + 'title': self.type, + 'date': self.type, + 'settings': self.settings, + } + +class VenueForm(ModelForm): + class Meta: + model = Venue + exclude = ['settings'] + def get_session(): + return Session() |
