How to use the peewee.FloatField function in peewee

To help you get started, we’ve selected a few peewee examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github vnpy / vnpy / vnpy / trader / database / database_sql.py View on Github external
volume: float = FloatField()
        open_interest: float = FloatField()
        last_price: float = FloatField()
        last_volume: float = FloatField()
        limit_up: float = FloatField()
        limit_down: float = FloatField()

        open_price: float = FloatField()
        high_price: float = FloatField()
        low_price: float = FloatField()
        pre_close: float = FloatField()

        bid_price_1: float = FloatField()
        bid_price_2: float = FloatField(null=True)
        bid_price_3: float = FloatField(null=True)
        bid_price_4: float = FloatField(null=True)
        bid_price_5: float = FloatField(null=True)

        ask_price_1: float = FloatField()
        ask_price_2: float = FloatField(null=True)
        ask_price_3: float = FloatField(null=True)
        ask_price_4: float = FloatField(null=True)
        ask_price_5: float = FloatField(null=True)

        bid_volume_1: float = FloatField()
        bid_volume_2: float = FloatField(null=True)
        bid_volume_3: float = FloatField(null=True)
        bid_volume_4: float = FloatField(null=True)
        bid_volume_5: float = FloatField(null=True)

        ask_volume_1: float = FloatField()
        ask_volume_2: float = FloatField(null=True)
github vnpy / vnpy / vnpy / trader / database / database_sql.py View on Github external
low_price: float = FloatField()
        pre_close: float = FloatField()

        bid_price_1: float = FloatField()
        bid_price_2: float = FloatField(null=True)
        bid_price_3: float = FloatField(null=True)
        bid_price_4: float = FloatField(null=True)
        bid_price_5: float = FloatField(null=True)

        ask_price_1: float = FloatField()
        ask_price_2: float = FloatField(null=True)
        ask_price_3: float = FloatField(null=True)
        ask_price_4: float = FloatField(null=True)
        ask_price_5: float = FloatField(null=True)

        bid_volume_1: float = FloatField()
        bid_volume_2: float = FloatField(null=True)
        bid_volume_3: float = FloatField(null=True)
        bid_volume_4: float = FloatField(null=True)
        bid_volume_5: float = FloatField(null=True)

        ask_volume_1: float = FloatField()
        ask_volume_2: float = FloatField(null=True)
        ask_volume_3: float = FloatField(null=True)
        ask_volume_4: float = FloatField(null=True)
        ask_volume_5: float = FloatField(null=True)

        class Meta:
            database = db
            indexes = ((("symbol", "exchange", "datetime"), True),)

        @staticmethod
github fact-project / pyfact / fact / factdb / models.py View on Github external
primary_key = CompositeKey('fnight', 'fsequenceid')


class SequenceInfo(FactDataModel):
    fazimuthmax = FloatField(column_name='fAzimuthMax', null=True)
    fazimuthmin = FloatField(column_name='fAzimuthMin', null=True)
    flastupdate = DateTimeField(column_name='fLastUpdate')
    fnight = IntegerField(column_name='fNight')
    fnumevents = IntegerField(column_name='fNumEvents')
    fsequenceduration = IntegerField(column_name='fSequenceDuration')
    fsequenceid = IntegerField(column_name='fSequenceID')
    fsequencestart = DateTimeField(column_name='fSequenceStart')
    fsequencestop = DateTimeField(column_name='fSequenceStop')
    fsourcekey = IntegerField(column_name='fSourceKEY')
    fzenithdistancemax = FloatField(column_name='fZenithDistanceMax', null=True)
    fzenithdistancemin = FloatField(column_name='fZenithDistanceMin', null=True)

    class Meta:
        table_name = 'SequenceInfo'
        indexes = (
            (('fnight', 'fsequenceid'), True),
        )
        primary_key = CompositeKey('fnight', 'fsequenceid')


class Source(FactDataModel):
    fdeclination = FloatField(column_name='fDeclination')
    fepochkey = IntegerField(column_name='fEpochKEY', null=True)
    fflux = FloatField(column_name='fFlux', null=True)
    fistoo = IntegerField(column_name='fIsToO')
    fmagnitude = FloatField(column_name='fMagnitude', null=True)
    frightascension = FloatField(column_name='fRightAscension')
github newsdev / elex / elex / loader / __init__.py View on Github external
Fields but no database connection.
    For flexibility.
    For the record, this is a single candidate's
    record in a single reporting unit.
    """
    accept_ap_calls = peewee.BooleanField(default=True)

    first = peewee.CharField(null=True)
    last = peewee.CharField(null=True)
    party = peewee.CharField(null=True)
    candidateid = peewee.CharField(null=True)
    polid = peewee.CharField(null=True)
    ballotorder = peewee.CharField(null=True)
    polnum = peewee.CharField(null=True)
    votecount = peewee.IntegerField(default=0)
    votepct = peewee.FloatField(default=0)
    winner = peewee.BooleanField(default=False)
    is_ballot_position = peewee.BooleanField(default=False)
    incumbent = peewee.BooleanField(default=False)

    description = peewee.CharField(null=True)
    test = peewee.BooleanField(default=False)
    raceid = peewee.CharField(null=True)
    statepostal = peewee.CharField(null=True)
    statename = peewee.CharField(null=True)
    racetype = peewee.CharField(null=True)
    reportingunitid = peewee.CharField(null=True)
    racetypeid = peewee.CharField(null=True)
    officeid = peewee.CharField(null=True)
    officename = peewee.CharField(null=True)
    party = peewee.CharField(null=True)
    seatname = peewee.CharField(null=True)
github PrefectHQ / prefect / prefect / models.py View on Github external
"""
    Database model for a Prefect TaskRun
    """

    flowrun = pw.ForeignKeyField(
        FlowRunModel, related_name='task_runs', index=True)
    task = pw.ForeignKeyField(TaskModel, related_name='task_runs', index=True)
    run_number = fields.IntegerField(default=1, index=True)

    created = pw.DateTimeField(default=datetime.datetime.now)
    scheduled_start = pw.DateTimeField(null=True, index=True)
    started = pw.DateTimeField(null=True)
    finished = pw.DateTimeField(null=True)
    heartbeat = pw.DateTimeField(null=True)

    progress = pw.FloatField(default=0)

    generated_by = pw.ForeignKeyField(
        deferred_taskrun, null=True, index=True, related_name='generated_task_runs')

    state = pw.IntegerField(default=0, index=True)

    class Meta:
        db_table = 'task_runs'
        indexes = (
            # unique index on flowrun / task / run #
            (('flowrun', 'task', 'run_number'), True),)


deferred_taskrun.set_model(TaskRunModel)
github fact-project / pyfact / fact / factdb / models.py View on Github external
fsourcekey = IntegerField(column_name='fSourceKEY', null=True)
    fsqmmaglinfitchi2 = FloatField(column_name='fSqmMagLinFitChi2', null=True)
    fsqmmaglinfitndf = IntegerField(column_name='fSqmMagLinFitNdf', null=True)
    fsqmmaglinfitpvalue = FloatField(column_name='fSqmMagLinFitPValue', null=True)
    fsqmmaglinfitslope = FloatField(column_name='fSqmMagLinFitSlope', null=True)
    fsqmmagmean = FloatField(column_name='fSqmMagMean', null=True)
    fsunzenithdistance = FloatField(column_name='fSunZenithDistance', null=True)
    ftngdust = FloatField(column_name='fTNGDust', null=True)
    fthresholdavgmean = FloatField(column_name='fThresholdAvgMean', null=True)
    fthresholdmax = IntegerField(column_name='fThresholdMax', null=True)
    fthresholdmedmean = FloatField(column_name='fThresholdMedMean', null=True)
    fthresholdmedrms = FloatField(column_name='fThresholdMedRms', null=True)
    fthresholdmedian = FloatField(column_name='fThresholdMedian', null=True)
    fthresholdminset = IntegerField(column_name='fThresholdMinSet', null=True)
    fthresholdmintimediff = IntegerField(column_name='fThresholdMinTimeDiff', null=True)
    ftriggerratemedian = FloatField(column_name='fTriggerRateMedian', null=True)
    ftriggerraterms = FloatField(column_name='fTriggerRateRms', null=True)
    ftriggerratetimeover100 = FloatField(column_name='fTriggerRateTimeOver100', null=True)
    ftriggerratetimeover125 = FloatField(column_name='fTriggerRateTimeOver125', null=True)
    ftriggerratetimeover150 = FloatField(column_name='fTriggerRateTimeOver150', null=True)
    ftriggerratetimeover175 = FloatField(column_name='fTriggerRateTimeOver175', null=True)
    fzenithdistancemax = FloatField(column_name='fZenithDistanceMax', null=True)
    fzenithdistancemean = FloatField(column_name='fZenithDistanceMean', null=True)
    fzenithdistancemin = FloatField(column_name='fZenithDistanceMin', null=True)

    class Meta:
        table_name = 'RunInfo'
        indexes = (
            (('fnight', 'frunid'), True),
        )
        primary_key = CompositeKey('fnight', 'frunid')
github gislite / maplet / torcms_maplet / model / map_tab.py View on Github external
uid = peewee.CharField(null=False, index=True, unique=True,
                           primary_key=True, max_length=36, help_text='')
    post_id = peewee.CharField(null=False, index=True, max_length=5, help_text='', )
    json_id = peewee.CharField(null=False, index=True, max_length=4, help_text='', )

class MabLayout(BaseModel):
    '''
    For Map layout.
    '''
    uid = peewee.CharField(null=False, index=True, unique=True,
                           primary_key=True, max_length=8, help_text='', )
    title = peewee.CharField(null=False, default='')
    post_id = peewee.CharField(null=False, index=True, max_length=5, help_text='', )
    user_id = peewee.CharField(null=False, index=True, max_length=36, help_text='', )
    json = peewee.CharField(null=True, default='', max_length=4)
    lon = peewee.FloatField(null=False, default=105)
    lat = peewee.FloatField(null=False, default=36)
    zoom = peewee.IntegerField(null=False, default=3)
    marker = peewee.IntegerField(null=False, default=0)
    time_create = peewee.IntegerField(null=False, default=0)
    time_update = peewee.IntegerField(null=False, default=0)
    public = peewee.IntegerField(null=False, default=0)