Skip to main content

Introduction

Naive aproach of pgfield with an external PG database

Basic instructions

  • 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

Content type definition

FOOBAR_PG = [
    Column("num", Float),
    Column("text", String, nullable=True)]

FOOBAR_SCHEMA = {
    "$schema": "http://json-schema.org/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,
        )
    )

Release files for guillotina-pgfield 2.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for guillotina-pgfield 2.0.1
File Size Uploaded
guillotina_pgfield-2.0.1.tar.gz 7.6 kB Details

Release files / guillotina_pgfield-2.0.1.tar.gz

Download URL guillotina_pgfield-2.0.1.tar.gz
Size 7.6 kB
Tags Source
SHA-256 checksum
How to use checksums
7849ae14afef634067114e4291955ef01e3b9c764bf0f9a550a9382c4e2e5b66
BLAKE2b-256 checksum
How to use checksums
d020092c56e90f9e4f053beb5e0eba7faef6c77ff202636e159a226e5bd758a1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.7.7

Release history Release notifications | RSS feed

This release

2.0.1 This release

1 release file

2.0.0

1 release file

1.0.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page