示例#1
0
文件: app.py 项目: fagcinsk/fatum
class UserSetting(db.Entity):
    id = PrimaryKey(int)
    username = Optional(str)
    distance = Required(int, default=3000)
    created_at = Required(datetime, default=datetime.utcnow)
    updated_at = Required(datetime, default=datetime.utcnow)
    points_count = Required(int, default=0)
示例#2
0
class DatabaseOrganization(database.Entity):  # type: ignore
    """Organization ORM model"""

    id = PrimaryKey(UUID, default=uuid4)
    name = Required(str)
    users = Set("DatabaseUser")
    date_created = Required(datetime, default=datetime.utcnow)
    modified_at = Optional(datetime)
示例#3
0
class Organisation(db.Entity):
    id = PrimaryKey(int, auto=True)
    Name = Optional(str)
    Description = Optional(str)
    Position = Optional(str)
    created = Optional(int)
    modified = Optional(int)
    accessed = Optional(int)
示例#4
0
class IruPerson(db.Entity):
    id = PrimaryKey(int, auto=True)
    name = Required(str)
    age = Optional(int)
    gender = Optional(int)
    school = Optional(str)
    enrolling_date = Optional(str)
    schooling_length = Optional(int)
    face_encodings = Required(Json)
示例#5
0
class DatabaseUser(database.Entity):  # type: ignore
    """User ORM model"""

    id = PrimaryKey(UUID, default=uuid4)
    organization = Required("DatabaseOrganization")
    username = Required(str)
    password = Required(str)
    date_created = Required(datetime, default=datetime.utcnow)
    modified_at = Optional(datetime)
示例#6
0
class RutrackerDownloadInfoPo(db.Entity):
    _table_ = "rutracker_album_download_info"
    id = PrimaryKey(int, auto=True)
    name= Required(str, max_len=512)
    url=Required(str)
    topicId=Required(int)
    status=Required(int, default=DownloadStatus.NOT)
    extra=Required(str, default="{}", max_len=4096)
    createTime=Required(datetime, default=datetime.today)
    lastModifiedTime=Required(datetime, default=datetime.today)
    lastOperator=Required(str, default="system")
示例#7
0
class ArtistMemberRelation(db.Entity):
    _table_ = "artist_relation"
    id = PrimaryKey(int, auto=True)
    artistId = Required(int)
    bandName = Required(str)
    bandId = Required(int)
    type = Required(str, default=ArtistBandRelationType.ACTIVE)
    work = Optional(str)
    extra = Required(str, default="{}", max_len=4096)
    createTime = Required(datetime, default=datetime.today)
    lastModifiedTime = Required(datetime, default=datetime.today)
    lastOperator = Required(str, default="system")
示例#8
0
class Meal(db.Entity):
    id = PrimaryKey(int, auto=True)
    buy_date = Required(date)
    expiration_date = Required(date)
    freezing_date = Required(date)
    description = Required(str)
    units = Required(int)
    weight = Required(float)
    unity = Required('Unity')
    category = Required('Category')
    subcategory = Optional('SubCategory')
    drawer = Optional(int)
    user = Required('User')
示例#9
0
class Music(db.Entity):
    _table_ = "music"
    id = PrimaryKey(int, auto=True)
    position = Required(int, auto=0)
    name = Required(str)
    artistId = Optional(int, default=0)
    otherArtistIds = Optional(str)
    duration = Optional(str)
    lyrics = Optional(str)
    extra = Required(str, default="{}", max_len=4096)
    createTime = Required(datetime, default=datetime.today)
    lastModifiedTime = Required(datetime, default=datetime.today)
    lastOperator = Required(str, default="system")
示例#10
0
class RutrackerForumPo(db.Entity):
    _table_ = "rutracker_forum_info"
    id = PrimaryKey(int, auto=True)
    forumId=Required(int, unique=True)
    name=Required(str, max_len=512)
    parentId=Required(int, default=0)
    parentForumId=Required(int)
    parentUrl=Optional(str, max_len=1024)
    url=Required(str, max_len=1024)
    totalPage=Required(int, default=0)
    extra=Required(str, default="{}", max_len=4096)
    createTime=Required(datetime, default=datetime.today)
    lastModifiedTime=Required(datetime, default=datetime.today)
    lastOperator=Required(str, default="system")
示例#11
0
class Album(db.Entity):
    _table_ = "album"
    id = PrimaryKey(int, auto=True)
    image = Optional(str)
    artistId = Optional(int, default=0)
    name = Required(str)
    type = Required(int, default=AlbumType.Unsorted)
    releaseDate = Required(int, default=1900)
    label = Optional(str, default="")
    format = Optional(str, default="CD")
    duration = Optional(str)
    extra = Required(str, default="{}", max_len=4096)
    createTime = Required(datetime, default=datetime.today)
    lastModifiedTime = Required(datetime, default=datetime.today)
    lastOperator = Required(str, default="system")
示例#12
0
class AlbumDownloadInfo(db.Entity):
    """
        Artist table
    """
    _table_ = "album_download_info"
    id = PrimaryKey(int, auto=True)
    albumId = Required(int)
    name = Required(str, max_len=512)
    src = Required(int)
    srcAlbumId = Optional(str)
    srcAlbumUrl = Optional(str)
    status = Required(int, default=DownloadStatus.NOT)
    extra = Required(str, default="{}", max_len=4096)
    createTime = Required(datetime, default=datetime.today)
    lastModifiedTime = Required(datetime, default=datetime.today)
    lastOperator = Required(str, default="system")
示例#13
0
class Mobile(db.Entity):
    uuid = PrimaryKey(uuid.UUID, default=uuid.uuid4)
    imei = Required(str)
    os_version = Required(str)
    device_version = Required(str)
    device_token = Required(str)
    public_key = Required(str)
    private_key = Required(str)
    ip = Required(str)

    def output(self):
        return {
            "uuid": self.uuid,
            "imei": self.imei,
            "os_version": self.os_version,
            "device_version": self.device_version,
            "device_token": self.device_token,
            "public_key": self.public_key,
            "private_key": self.private_key,
            "ip": self.ip
        }
示例#14
0
class RutrackerForumItemPo(db.Entity):
    _table_ = "rutracker_forum_item_info"
    id = PrimaryKey(int, auto=True)
    topicId=Required(str)
    topicUrl=Required(str, max_len=1024)
    forumId=Required(int, default=0)
    rutrackerForumId=Required(int)
    topicIcon=Optional(str, max_len=1024)
    newstLink=Optional(str, max_len=1024)
    approvedLabel=Optional(str, max_len=128)
    torTopicTitle=Required(str, max_len=2048)
    topicAuthor=Required(str, max_len=128)
    seeders=Optional(int, default=0)
    leechers=Optional(int, default=0)
    magnet=Optional(str, max_len=2048, default="")
    torrentUrl=Optional(str, max_len=1024, default="")
    fileSize=Optional(str, max_len=32)
    nReplies=Optional(int, default=0)
    nDownloads=Optional(int, default=0)
    lastPostTime=Optional(str)
    lastPostUser=Optional(str)
    lastPostUrl=Optional(str)
示例#15
0
class Artist(db.Entity):
    """
        Artist table
    """
    _table_ = "artist"
    id = PrimaryKey(int, auto=True)
    name = Required(str, max_len=512)
    country = Optional(str)
    location = Optional(str)
    image = Optional(str)
    age = Required(int, default=defaultAge)
    gender = Required(int, default=GenderEnum.MALE)
    isBand = Required(int, default=BandEnum.UNKOWN)
    status = Required(int, default=StatusEnum.ACTIVE)
    genre = Optional(str)
    lyricalThemes = Optional(str)
    currentLabel = Required(str, default="UNKOWN")
    FormedIn = Required(int, default=0)
    yearsActive = Optional(str)
    extra = Required(str, default="{}", max_len=4096)
    createTime = Required(datetime, default=datetime.today)
    lastModifiedTime = Required(datetime, default=datetime.today)
    lastOperator = Required(str, default="system")
    orm.composite_key(name, country)
示例#16
0
class Category(db.Entity):
    id = PrimaryKey(int, auto=True)
    description = Required(str, unique=True)
    subcategories = Set(SubCategory)
    meals = Set(Meal)
示例#17
0
class Quote(database.Entity):
    _table_ = "quotes"
    id = PrimaryKey(int, auto=True)
    text = Required(str)
    author = Required(str)
示例#18
0
class User(db.Entity, UserMixin):
    id = PrimaryKey(int, auto=True)
    name = Required(str, unique=True)
    password = Required(str)
    meals = Set(Meal)
示例#19
0
class Unity(db.Entity):
    symbol = PrimaryKey(str)
    meals = Set(Meal)
示例#20
0
        class TestTable(db.Entity):
            _table_ = "test"

            id = PrimaryKey(int, auto=True)
            name = Required(str)
示例#21
0
class CustomCommandModel(database.Entity):
    _table_ = "custom_commands"
    command = PrimaryKey(str)
    emit = Required(str)
    counter = Optional(int)
示例#22
0
class SubCategory(db.Entity):
    id = PrimaryKey(int, auto=True)
    description = Required(str, unique=True)
    category = Required('Category')
    meals = Set(Meal)