Guillotina的Postgres字段支持
项目描述
简介
使用外部PG数据库的pgfield的简单方法
基本说明
- Python >= 3.7
- PostgreSQL >= 9.6
load_utilities:
pgfield:
factory: guillotina_pgfield.utility.PGFieldUtility
provides: guillotina_pgfield.interfaces.IPGFieldUtility
settings:
dsn: postgres://user:passwd@pg_url:5432/db
pool_size: 10
内容类型定义
FOOBAR_PG = [
Column("num", Float),
Column("text", String, nullable=True)]
FOOBAR_SCHEMA = {
"$schema": "https://json-schema.fullstack.org.cn/draft-07/schema#",
"type": "object",
"properties": {
"num": {"type": "number"},
"text": {"type": "string"}
}
}
async def foobar_validator(context, value):
return True
class IFoobarType(Interface):
foobar = PatchField(
PGListField(
title="foobar",
json_schema=FOOBAR_SCHEMA,
validator=foobar_validator,
pg_schema=FOOBAR_PG,
pg_table="foobar",
required=False,
)
)
项目详情
关闭
guillotina_pgfield-2.0.1.tar.gz的哈希值
算法 | 哈希摘要 | |
---|---|---|
SHA256 | 7849ae14afef634067114e4291955ef01e3b9c764bf0f9a550a9382c4e2e5b66 |
|
MD5 | 7ab92b9fca072a6a68ad1b22fccb2011 |
|
BLAKE2b-256 | d020092c56e90f9e4f053beb5e0eba7faef6c77ff202636e159a226e5bd758a1 |