当前位置: 首页>>代码示例>>Python>>正文


Python peewee.TextField方法代码示例

本文整理汇总了Python中peewee.TextField方法的典型用法代码示例。如果您正苦于以下问题:Python peewee.TextField方法的具体用法?Python peewee.TextField怎么用?Python peewee.TextField使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在peewee的用法示例。


在下文中一共展示了peewee.TextField方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: _create_model

# 需要导入模块: import peewee [as 别名]
# 或者: from peewee import TextField [as 别名]
def _create_model(self, db, table_prefix):
        """
        创建数据model
        """
        meta_dict = {
            "database": db,
            "table_name": table_prefix + "_" + "Report"
        }
        meta = type("Meta", (object, ), meta_dict)
        model_dict = {
            "id": peewee.AutoField(),
            "plugin_name": peewee.CharField(max_length=63),
            "description": peewee.TextField(),
            "rasp_result_list": self.LongTextField(),
            "payload_seq": peewee.CharField(unique=True, max_length=63),
            "message": peewee.TextField(),
            "time": peewee.IntegerField(default=common.get_timestamp),
            "upload": peewee.IntegerField(default=0),
            "Meta": meta
        }
        self.Report = type("Report", (peewee.Model, ), model_dict)
        return self.Report 
开发者ID:baidu-security,项目名称:openrasp-iast,代码行数:24,代码来源:report_model.py

示例2: _create_model

# 需要导入模块: import peewee [as 别名]
# 或者: from peewee import TextField [as 别名]
def _create_model(self, db, table_prefix):
        """
        创建数据model
        """
        meta_dict = {
            "database": db,
            "table_name": "Config"
        }
        meta = type("Meta", (object, ), meta_dict)
        model_dict = {
            "host_port_hash": peewee.CharField(primary_key=True, max_length=63),
            "host_port": peewee.TextField(),
            "config_json": peewee.TextField(),
            "Meta": meta
        }
        self.Config = type("Config", (peewee.Model, ), model_dict)
        return self.Config 
开发者ID:baidu-security,项目名称:openrasp-iast,代码行数:19,代码来源:config_model.py

示例3: __init__

# 需要导入模块: import peewee [as 别名]
# 或者: from peewee import TextField [as 别名]
def __init__(self, data_model):
        self.data_model = data_model
        self.data_model.fake_item_ids_store = self

        assert self.data_model.cache_dir, "FakeItemIds need cache_dir from data_model!"
        sqlite_path = os.path.join(self.data_model.cache_dir, "fake_item_ids_store.db")

        sqlite_database = SqliteDatabase(sqlite_path, check_same_thread=False)

        class FakeItemIdsStore(Model):
            is_deleted = BooleanField(default=False)  # mark processed or duplicated items
            item_id = CharField()
            item_content_json = TextField()
            created_at = TimeField(default=datetime.datetime.now)

            class Meta:
                database = sqlite_database
        self.storage = FakeItemIdsStore

        if not self.storage.table_exists():
            self.storage.create_table()
            sqlite_database.create_index(self.storage, "is_deleted item_id".split(" ")) 
开发者ID:17zuoye,项目名称:detdup,代码行数:24,代码来源:fake_item_ids.py

示例4: migrate

# 需要导入模块: import peewee [as 别名]
# 或者: from peewee import TextField [as 别名]
def migrate(migrator):
    return [migrator.add_column("event", "country", peewee.TextField(default="US"))] 
开发者ID:theacodes,项目名称:conducthotline.com,代码行数:4,代码来源:0003_add_event_country.py

示例5: migrate

# 需要导入模块: import peewee [as 别名]
# 或者: from peewee import TextField [as 别名]
def migrate(migrator):
    return [
        migrator.add_column(
            "event", "voice_greeting", peewee.TextField(null=True, index=False)
        ),
        migrator.add_column(
            "event", "sms_greeting", peewee.TextField(null=True, index=False)
        ),
    ] 
开发者ID:theacodes,项目名称:conducthotline.com,代码行数:11,代码来源:0001_add_greeting_customization_fields.py

示例6: migrate

# 需要导入模块: import peewee [as 别名]
# 或者: from peewee import TextField [as 别名]
def migrate(migrator):
    return [
        migrator.add_column(
            "number", "features", peewee.TextField(default="SMS,VOICE", index=False)
        )
    ] 
开发者ID:theacodes,项目名称:conducthotline.com,代码行数:8,代码来源:0004_add_number_features.py

示例7: migrate

# 需要导入模块: import peewee [as 别名]
# 或者: from peewee import TextField [as 别名]
def migrate(migrator):
    return [
        migrator.add_column(
            "auditlog", "reporter_number", peewee.TextField(null=True, index=False)
        ),
        CreateModels(),
    ] 
开发者ID:theacodes,项目名称:conducthotline.com,代码行数:9,代码来源:0002_add_blocklist.py

示例8: test_change_column_type_char_text

# 需要导入模块: import peewee [as 别名]
# 或者: from peewee import TextField [as 别名]
def test_change_column_type_char_text(self):
    class SomeModel(pw.Model):
      some_field = pw.CharField(default='woot')
      class Meta:
        database = self.db
    self.evolve_and_check_noop()
    model = SomeModel.create()
    self.assertEqual(model.some_field, 'woot')
    peeweedbevolve.clear()
    class SomeModel(pw.Model):
      some_field = pw.TextField(default='woot')
      class Meta:
        database = self.db
    self.evolve_and_check_noop()
    self.assertEqual(SomeModel.select().first().some_field, 'woot') 
开发者ID:keredson,项目名称:peewee-db-evolve,代码行数:17,代码来源:test.py


注:本文中的peewee.TextField方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。