Пример #1
0
class DataclickStat(Model):
    time = DateField()
    user_id = UInt32Field()
    join_date = NullableField(DateField())
    registration_date = NullableField(DateField())
    name = StringField()
    email = StringField()
    is_guest = UInt8Field()
    step_id = UInt32Field()
    action_id = UInt8Field()
    event_id = UInt32Field()

    engine = Memory()

    @property
    def time_as_str(self):
        return self.time.strftime('%d-%m-%Y') if self.time else '00-00-0000'

    @property
    def join_date_as_str(self):
        return self.join_date.strftime(
            '%d-%m-%Y') if self.join_date else '00-00-0000'

    @property
    def registration_date_as_str(self):
        return self.registration_date.strftime(
            '%d-%m-%Y') if self.registration_date else '00-00-0000'
Пример #2
0
class IOC_OTX(Model):

    event_date = DateField()
    timestamp = DateTimeField()
    indicator = StringField()
    name = StringField()
    references = StringField()
    #engine = MergeTree('event_date', ('timestamp', 'indicator', 'name', 'references'))
    engine = Memory()
Пример #3
0
class Person(Model):
    id = UInt64Field()
    first_name = StringField()
    last_name = StringField()
    gender = StringField()
    email = StringField()
    birth_date = UInt64Field()

    engine = Memory()
Пример #4
0
 class TestModel(Model):
     i = Int16Field()
     f = UUIDField()
     engine = Memory()
Пример #5
0
 class TestModel(Model):
     i = Int16Field()
     f = BooleanField()
     engine = Memory()
Пример #6
0
 class TestModel(Model):
     a = DateTimeField(default=datetime.datetime(2020, 1, 1))
     b = DateField(default=F.toDate(a))
     c = Int32Field(default=7)
     d = Int32Field(default=c * 5)
     engine = Memory()
Пример #7
0
 class Model1(Model):
     system = StringField()
     readonly = StringField()
     engine = Memory()