diff options
| author | Jules Laplace <julescarbon@gmail.com> | 2020-07-04 16:37:19 +0200 |
|---|---|---|
| committer | Jules Laplace <julescarbon@gmail.com> | 2020-07-04 16:37:19 +0200 |
| commit | e973412b5ea29685f4fa260d8eb44baae095fb81 (patch) | |
| tree | 0e859ab0541187ed769e654663730834b998f3d1 /animism-align/cli/app/sql/models/timestamp.py | |
| parent | 3e1c6f81bbdad758b8756955fce82da49a564611 (diff) | |
rename timestamp to annotation
Diffstat (limited to 'animism-align/cli/app/sql/models/timestamp.py')
| -rw-r--r-- | animism-align/cli/app/sql/models/timestamp.py | 39 |
1 files changed, 0 insertions, 39 deletions
diff --git a/animism-align/cli/app/sql/models/timestamp.py b/animism-align/cli/app/sql/models/timestamp.py deleted file mode 100644 index c2bf410..0000000 --- a/animism-align/cli/app/sql/models/timestamp.py +++ /dev/null @@ -1,39 +0,0 @@ -from sqlalchemy import create_engine, Table, Column, Text, String, Integer, 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.sql.models.page import Page - -from app.settings import app_cfg - -class Timestamp(Base): - """Table for storing references to graphs""" - __tablename__ = 'timestamp' - id = Column(Integer, primary_key=True) - type = Column(String(16, convert_unicode=True), nullable=False) - paragraph_id = Column(Integer, ForeignKey('paragraph.id'), nullable=True) - start_ts = Column(Float, nullable=False) - end_ts = Column(Float, nullable=True) - sentence = Column(Text(convert_unicode=True), nullable=True) - settings = Column(JSON, default={}, nullable=True) - - def toJSON(self): - return { - 'id': self.id, - 'type': self.type, - 'paragraph_id': self.paragraph_id, - 'start_ts': self.start_ts, - 'end_ts': self.end_ts, - 'sentence': self.description, - 'settings': self.settings, - } - -class TimestampForm(ModelForm): - class Meta: - model = Timestamp - exclude = ['settings'] - def get_session(): - return Session() |
