示例#1
0
class Message(orm.SQLObject):
    """The class generates a Message table containing information
    about user messages.

    Args:
        text (str, optional):
        time (int, optional):
        filePicture (byte, optional):
        fileVideo (byte, optional):
        fileAudio (byte, optional):
        fileDocument (byte, optional):
        emoji (str, optional):
        editedTime (int, optional):
        editedStatus (bool, optional):

    Returns:
        None
    """
    text = orm.StringCol(default=None)
    time = orm.IntCol(default=None)
    filePicture = orm.BLOBCol(default=None)
    fileVideo = orm.BLOBCol(default=None)
    fileAudio = orm.BLOBCol(default=None)
    fileDocument = orm.BLOBCol(default=None)
    emoji = orm.BLOBCol(default=None)
    editedTime = orm.IntCol(default=None)
    editedStatus = orm.BoolCol(default=False)
    userConfig = orm.ForeignKey('UserConfig', refColumn="uuid")
    flow = orm.ForeignKey('Flow', refColumn="flowId")
示例#2
0
class CatalogGenData(sqlobject.SQLObject):
  """Fields required to generate the catalog.

  Having this smaller table lets us avoid fetching the main big data
  structure.
  """
  deps = sqlobject.BLOBCol(notNone=True, length=(2 ** 14 - 1))
  i_deps = sqlobject.BLOBCol(notNone=True, length=(2 ** 14 - 1))
  pkginfo_name = sqlobject.BLOBCol(notNone=True, length=(2 ** 14 - 1))
  pkgname = sqlobject.UnicodeCol(default=None, length=250)
  md5_sum = sqlobject.UnicodeCol(notNone=True, unique=True, length=32)
示例#3
0
class Srv4FileStatsBlob(sqlobject.SQLObject):
    """Holds pickled data structures.

  This table holds potentially large amounts of data (>1MB per row),
  and is separated to make Srv4FileStats lighter.  Sometimes, we don't
  need to retrieve the heavy pickled data if we want to read just a few
  text fields.
  """
    pickle = sqlobject.BLOBCol(notNone=True, length=(2**24))
    srv4_file = sqlobject.SingleJoin('Srv4FileStats')
示例#4
0
class ElfdumpInfoBlob(sqlobject.SQLObject):
  """Holds JSON with elfdump information for a package.

  Indexed by the md5 sum of the binary.
  """
  class sqlmeta:
    cacheValues = False
  md5_sum = sqlobject.UnicodeCol(notNone=True, unique=True, length=32)
  json = sqlobject.BLOBCol(notNone=True, length=(2**24 - 1))
  content_md5_sum = sqlobject.UnicodeCol(notNone=True, unique=False, length=32)
  mime_type = sqlobject.UnicodeCol(notNone=True, length=250)
示例#5
0
class UserConfig(orm.SQLObject):
    """The class generates a table containing data
    about the user and his settings.

    Args:
        uuid (int, required):
        login (str, required):
        password (str, required):
        hash_password (str, optional)
        username (str, optional):
        isBot (bool, optional): default False
        authId (str, optional):
        email (str, optional):
        avatar (str, optional):
        bio (str, optional):
        salt (str, optional):
        key (str, optional):

    Returns:
        None
    """
    # added alternateID for added class method @byUUID
    # which will return that object
    uuid = orm.IntCol(alternateID=True, unique=True, notNone=True)
    login = orm.StringCol()
    password = orm.StringCol()
    hashPassword = orm.StringCol(default=None)
    username = orm.StringCol(default=None)
    isBot = orm.BoolCol(default=False)
    authId = orm.StringCol(default=None)
    email = orm.StringCol(default=None)
    avatar = orm.BLOBCol(default=None)
    bio = orm.StringCol(default=None)
    salt = orm.BLOBCol(default=None)
    key = orm.BLOBCol(default=None)
    # Connection to the Message table
    message = orm.MultipleJoin('Message')
示例#6
0
class Srv4FileStatsBlob(sqlobject.SQLObject):
  """Holds serialized data structures in JSON.

  This table holds potentially large amounts of data (>1MB per row),
  and is separated to make Srv4FileStats lighter.  Sometimes, we don't
  need to retrieve the heavy pickled data if we want to read just a few
  text fields.
  """
  class sqlmeta:
    cacheValues = False
  md5_sum = sqlobject.UnicodeCol(notNone=True, unique=True, length=32)
  json = sqlobject.BLOBCol(notNone=True, length=(2**24))
  content_md5_sum = sqlobject.UnicodeCol(notNone=True, unique=False, length=32)
  mime_type = sqlobject.UnicodeCol(notNone=True, length=250)
  created_on = sqlobject.DateTimeCol(
      notNone=True,
      default=sqlobject.DateTimeCol.now)
示例#7
0
    class P2spTask(sqlobject.SQLObject):
        # app_id = sqlobject.StringCol(length=14, unique=True)
        TaskId = sqlobject.BigIntCol(length=0,
                                     dbName='TaskId',
                                     alternateID=False)
        ResourceUsageStrategy = sqlobject.IntCol(
            length=0, dbName='ResourceUsageStrategy')
        ResourceReportStrategy = sqlobject.IntCol(
            length=0, dbName='ResourceReportStrategy')
        Cookie = sqlobject.StringCol(length=0)
        AccountNeeded = sqlobject.IntCol(length=0, dbName='AccountNeeded')
        UserName = sqlobject.StringCol(length=0, dbName='UserName')
        Password = sqlobject.StringCol(length=0)
        UseOriginResourceOnly = sqlobject.IntCol(
            length=0, dbName='UseOriginResourceOnly')
        OriginResourceSupportRange = sqlobject.IntCol(
            length=0, dbName='OriginResourceSupportRange')
        ReceiveOriginResourceSize = sqlobject.BigIntCol(
            length=0, dbName='ReceiveOriginResourceSize')
        OriginResourceRetryInterval = sqlobject.IntCol(
            length=0, dbName='OriginResourceRetryInterval')
        OriginResourceRetryTimes = sqlobject.IntCol(
            length=0, dbName='OriginResourceRetryTimes')
        OriginResourceThreadCount = sqlobject.IntCol(
            length=0, dbName='OriginResourceThreadCount')
        DownloadSpeedLimit = sqlobject.IntCol(length=0,
                                              dbName='DownloadSpeedLimit')
        FileNameFixed = sqlobject.IntCol(length=0, dbName='FileNameFixed')
        HttpRequestHeader = sqlobject.BLOBCol(length=0,
                                              dbName='HttpRequestHeader')
        VideoHeadFirstTime = sqlobject.IntCol(length=0,
                                              dbName='VideoHeadFirstTime')
        VideoHeadFirstStatus = sqlobject.IntCol(length=0,
                                                dbName='VideoHeadFirstStatus')
        ResourceQuerySize = sqlobject.BigIntCol(length=0,
                                                dbName='ResourceQuerySize')
        DisplayUrl = sqlobject.StringCol(length=0, dbName='DisplayUrl')
        UserAgent = sqlobject.StringCol(length=0, dbName='UserAgent')

        class sqlmeta:
            table = 'P2spTask'
            idName = 'TaskId'
示例#8
0
    class TaskBase(sqlobject.SQLObject):
        # app_id = sqlobject.StringCol(length=14, unique=True)
        TaskId = sqlobject.BigIntCol(length=0, dbName='TaskId')
        Type = sqlobject.IntCol(length=0, dbName='Type')
        Status = sqlobject.IntCol(length=0, dbName='Status')
        StatusChangeTime = sqlobject.BigIntCol(length=0,
                                               dbName='StatusChangeTime')
        SavePath = sqlobject.StringCol(length=0, dbName='SavePath')
        TotalReceiveSize = sqlobject.BigIntCol(length=0,
                                               dbName='TotalReceiveSize')
        TotalSendSize = sqlobject.BigIntCol(length=0, dbName='TotalSendSize')
        TotalReceiveValidSize = sqlobject.BigIntCol(
            length=0, dbName='TotalReceiveValidSize')
        TotalUploadSize = sqlobject.BigIntCol(length=0,
                                              dbName='TotalUploadSize')
        CreationTime = sqlobject.BigIntCol(length=0, dbName='CreationTime')
        FileCreated = sqlobject.IntCol(length=0, dbName='FileCreated')
        CompletionTime = sqlobject.BigIntCol(length=0, dbName='CompletionTime')
        DownloadingPeriod = sqlobject.BigIntCol(length=0,
                                                dbName='DownloadingPeriod')
        RemovingToRecycleTime = sqlobject.BigIntCol(
            length=0, dbName='RemovingToRecycleTime')
        FailureErrorCode = sqlobject.IntCol(length=0,
                                            dbName='FailureErrorCode')
        Url = sqlobject.StringCol(length=0, dbName='Url')
        ReferenceUrl = sqlobject.StringCol(length=0, dbName='ReferenceUrl')
        ResourceSize = sqlobject.BigIntCol(length=0, dbName='ResourceSize')
        Name = sqlobject.StringCol(length=0, dbName='Name')
        Cid = sqlobject.BLOBCol(length=0, dbName='Cid')
        Gcid = sqlobject.BLOBCol(length=0, dbName='Gcid')
        Description = sqlobject.StringCol(length=0, dbName='Description')
        CategoryId = sqlobject.IntCol(length=0, dbName='CategoryId')
        ResourceQueryCid = sqlobject.BLOBCol(length=0,
                                             dbName='ResourceQueryCid')
        CreationRequestType = sqlobject.IntCol(length=0,
                                               dbName='CreationRequestType')
        StartMode = sqlobject.IntCol(length=0, dbName='StartMode')
        NamingType = sqlobject.IntCol(length=0, dbName='NamingType')
        StatisticsReferenceUrl = sqlobject.StringCol(
            length=0, dbName='StatisticsReferenceUrl')
        UserRead = sqlobject.IntCol(length=0, dbName='UserRead')
        FileSafetyFlag = sqlobject.IntCol(length=0, dbName='FileSafetyFlag')
        Playable = sqlobject.IntCol(length=0, dbName='Playable')
        BlockInfo = sqlobject.BLOBCol(length=0, dbName='BlockInfo')
        OpenOnComplete = sqlobject.IntCol(length=0, dbName='OpenOnComplete')
        SpecialType = sqlobject.IntCol(length=0, dbName='SpecialType')
        Proxy = sqlobject.BLOBCol(length=0, dbName='Proxy')
        OriginReceiveSize = sqlobject.BigIntCol(length=0,
                                                dbName='OriginReceiveSize')
        P2pReceiveSize = sqlobject.BigIntCol(length=0, dbName='P2pReceiveSize')
        P2sReceiveSize = sqlobject.BigIntCol(length=0, dbName='P2sReceiveSize')
        OfflineReceiveSize = sqlobject.BigIntCol(length=0,
                                                 dbName='OfflineReceiveSize')
        VipReceiveSize = sqlobject.BigIntCol(length=0, dbName='VipReceiveSize')
        VipResourceEnableNecessary = sqlobject.IntCol(
            length=0, dbName='VipResourceEnableNecessary')
        ConsumedVipSize = sqlobject.BigIntCol(length=0,
                                              dbName='ConsumedVipSize')
        Forbidden = sqlobject.IntCol(length=0, dbName='Forbidden')
        OptionalChannelDataSize = sqlobject.BLOBCol(
            length=0, dbName='OptionalChannelDataSize')
        OwnerProductId = sqlobject.IntCol(length=0, dbName='OwnerProductId')
        UserData = sqlobject.BLOBCol(length=0, dbName='UserData')
        # UserData = sqlobject.StringCol(length=0, dbName='UserData')
        UrlCodePage = sqlobject.IntCol(length=0, dbName='UrlCodePage')
        ReferenceUrlCodePage = sqlobject.IntCol(length=0,
                                                dbName='ReferenceUrlCodePage')
        StatisticsReferenceUrlCodePage = sqlobject.IntCol(
            length=0, dbName='StatisticsReferenceUrlCodePage')
        GroupTaskId = sqlobject.BigIntCol(length=0, dbName='GroupTaskId')
        DownloadSubTask = sqlobject.IntCol(length=0, dbName='DownloadSubTask')
        TagValue = sqlobject.IntCol(length=0, dbName='TagValue')
        InnerNatReceiveSize = sqlobject.BigIntCol(length=0,
                                                  dbName='InnerNatReceiveSize')
        AdditionFlag = sqlobject.IntCol(length=0, dbName='AdditionFlag')
        ProductInfo = sqlobject.StringCol(length=0, dbName='ProductInfo')

        class sqlmeta:
            table = 'TaskBase'
            idName = 'TaskId'
示例#9
0
class Log(sqlobject.SQLObject):
    """Class implementing a Log"""

    job = sqlobject.ForeignKey('Job', cascade=True)
    text = sqlobject.BLOBCol(default="No build log available")