1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137
|
from sqlalchemy import Boolean, Column, DateTime, ForeignKey, Index, Integer, String, Table, Text from sqlalchemy.orm import relationship from sqlalchemy.sql.sqltypes import NullType from flask_sqlalchemy import SQLAlchemy
db = SQLAlchemy()
class AuthGroup(db.Model): __tablename__ = 'auth_group'
id = db.Column(db.Integer, primary_key=True) name = db.Column(db.String(80), nullable=False)
class AuthGroupPermission(db.Model): __tablename__ = 'auth_group_permissions' __table_args__ = ( db.Index('auth_group_permissions_group_id_permission_id_0cd325b0_uniq', 'group_id', 'permission_id'), )
id = db.Column(db.Integer, primary_key=True) group_id = db.Column(db.ForeignKey('auth_group.id'), nullable=False, index=True) permission_id = db.Column(db.ForeignKey('auth_permission.id'), nullable=False, index=True)
group = db.relationship('AuthGroup', primaryjoin='AuthGroupPermission.group_id == AuthGroup.id', backref='auth_group_permissions') permission = db.relationship('AuthPermission', primaryjoin='AuthGroupPermission.permission_id == AuthPermission.id', backref='auth_group_permissions')
class AuthPermission(db.Model): __tablename__ = 'auth_permission' __table_args__ = ( db.Index('auth_permission_content_type_id_codename_01ab375a_uniq', 'content_type_id', 'codename'), )
id = db.Column(db.Integer, primary_key=True) content_type_id = db.Column(db.ForeignKey('django_content_type.id'), nullable=False, index=True) codename = db.Column(db.String(100), nullable=False) name = db.Column(db.String(255), nullable=False)
content_type = db.relationship('DjangoContentType', primaryjoin='AuthPermission.content_type_id == DjangoContentType.id', backref='auth_permissions')
class AuthUser(db.Model): __tablename__ = 'auth_user'
id = db.Column(db.Integer, primary_key=True) password = db.Column(db.String(128), nullable=False) last_login = db.Column(db.DateTime) is_superuser = db.Column(db.Boolean, nullable=False) first_name = db.Column(db.String(30), nullable=False) last_name = db.Column(db.String(30), nullable=False) email = db.Column(db.String(254), nullable=False) is_staff = db.Column(db.Boolean, nullable=False) is_active = db.Column(db.Boolean, nullable=False) date_joined = db.Column(db.DateTime, nullable=False) username = db.Column(db.String(150), nullable=False)
class AuthUserGroup(db.Model): __tablename__ = 'auth_user_groups' __table_args__ = ( db.Index('auth_user_groups_user_id_group_id_94350c0c_uniq', 'user_id', 'group_id'), )
id = db.Column(db.Integer, primary_key=True) user_id = db.Column(db.ForeignKey('auth_user.id'), nullable=False, index=True) group_id = db.Column(db.ForeignKey('auth_group.id'), nullable=False, index=True)
group = db.relationship('AuthGroup', primaryjoin='AuthUserGroup.group_id == AuthGroup.id', backref='auth_user_groups') user = db.relationship('AuthUser', primaryjoin='AuthUserGroup.user_id == AuthUser.id', backref='auth_user_groups')
class AuthUserUserPermission(db.Model): __tablename__ = 'auth_user_user_permissions' __table_args__ = ( db.Index('auth_user_user_permissions_user_id_permission_id_14a6b632_uniq', 'user_id', 'permission_id'), )
id = db.Column(db.Integer, primary_key=True) user_id = db.Column(db.ForeignKey('auth_user.id'), nullable=False, index=True) permission_id = db.Column(db.ForeignKey('auth_permission.id'), nullable=False, index=True)
permission = db.relationship('AuthPermission', primaryjoin='AuthUserUserPermission.permission_id == AuthPermission.id', backref='auth_user_user_permissions') user = db.relationship('AuthUser', primaryjoin='AuthUserUserPermission.user_id == AuthUser.id', backref='auth_user_user_permissions')
class DjangoAdminLog(db.Model): __tablename__ = 'django_admin_log'
id = db.Column(db.Integer, primary_key=True) object_id = db.Column(db.Text) object_repr = db.Column(db.String(200), nullable=False) action_flag = db.Column(db.Integer, nullable=False) change_message = db.Column(db.Text, nullable=False) content_type_id = db.Column(db.ForeignKey('django_content_type.id'), index=True) user_id = db.Column(db.ForeignKey('auth_user.id'), nullable=False, index=True) action_time = db.Column(db.DateTime, nullable=False)
content_type = db.relationship('DjangoContentType', primaryjoin='DjangoAdminLog.content_type_id == DjangoContentType.id', backref='django_admin_logs') user = db.relationship('AuthUser', primaryjoin='DjangoAdminLog.user_id == AuthUser.id', backref='django_admin_logs')
class DjangoContentType(db.Model): __tablename__ = 'django_content_type' __table_args__ = ( db.Index('django_content_type_app_label_model_76bd3d3b_uniq', 'app_label', 'model'), )
id = db.Column(db.Integer, primary_key=True) app_label = db.Column(db.String(100), nullable=False) model = db.Column(db.String(100), nullable=False)
class DjangoMigration(db.Model): __tablename__ = 'django_migrations'
id = db.Column(db.Integer, primary_key=True) app = db.Column(db.String(255), nullable=False) name = db.Column(db.String(255), nullable=False) applied = db.Column(db.DateTime, nullable=False)
class DjangoSession(db.Model): __tablename__ = 'django_session'
session_key = db.Column(db.String(40), primary_key=True) session_data = db.Column(db.Text, nullable=False) expire_date = db.Column(db.DateTime, nullable=False, index=True)
t_sqlite_sequence = db.Table( 'sqlite_sequence', db.Column('name', db.NullType), db.Column('seq', db.NullType) )
|