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'
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()
class Person(Model): id = UInt64Field() first_name = StringField() last_name = StringField() gender = StringField() email = StringField() birth_date = UInt64Field() engine = Memory()
class TestModel(Model): i = Int16Field() f = UUIDField() engine = Memory()
class TestModel(Model): i = Int16Field() f = BooleanField() engine = Memory()
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()
class Model1(Model): system = StringField() readonly = StringField() engine = Memory()