Exemple #1
0
class UserInfo(db.Model):
    timezone_id = db.Column(db.Integer, db.ForeignKey('public.timezone.id'))
    timezone = db.relationship('Timezone',
                               primaryjoin='Timezone.id==UserInfo.timezone_id')

    user_id = db.Column(db.Integer, primary_key=True)

    __tablename__ = 'user_info'
    __table_args__ = {'schema': 'aaa'}
Exemple #2
0
class User(db.Model):
    active = db.Column(db.Boolean)
    default_ipv4_mask = db.Column(db.Integer)
    default_ipv6_mask = db.Column(db.Integer)
    max_concurrent_sessions = db.Column(db.Integer)
    registration_utc = db.Column(db.DateTime(timezone=True))
    timezone_id = db.Column(db.Integer, db.ForeignKey('public.timezone.id'))
    timezone = db.relationship('Timezone', primaryjoin='Timezone.id==User.timezone_id')
    user_id = db.Column(db.Integer, primary_key=True)

    __tablename__ = 'user'
    __table_args__ = {'schema':'aaa'}
Exemple #3
0
from skeleton import db

PageTags = db.Table('page_tags', db.metadata,
    db.Column('page_id', db.Integer, db.ForeignKey('public.page.id')),
    db.Column('tag_id', db.Integer, db.ForeignKey('public.tag.id')),
    schema='public'
)
Exemple #4
0
                           backref=db.backref('pages', lazy='dynamic'))
    __tablename__ = 'page'
    __table_args__ = {'schema': 'public'}

    def __init__(self, url=url):
        self.url = url


########NEW FILE########
__FILENAME__ = page_tags
from skeleton import db

PageTags = db.Table('page_tags',
                    db.metadata,
                    db.Column('page_id', db.Integer,
                              db.ForeignKey('public.page.id')),
                    db.Column('tag_id', db.Integer,
                              db.ForeignKey('public.tag.id')),
                    schema='public')

########NEW FILE########
__FILENAME__ = tag
from skeleton import db


class Tag(db.Model):
    id = db.Column(db.Integer, primary_key=True)
    name = db.Column(db.String)

    # Placeholders:
    # pages is created automatically via the Page model