Skip to main content

Store Implementation for Content in MongoDB

Project description

Python MongoDB Content Store

Python Store Implementation for Content in MongoDB

Usage

from frappymongocontent import ContentStore

MONGO_URL = "mongodb://localhost:27017"
content_store = ContentStore(mongo_url=MONGO_URL, mongo_db="myDatabase", collection_name="content")
content_list = content_store.find_by_reference("my-demo")
for item in content_list:
    print(item.content, "is a dictionary with all the content")

Methods

Base methods provided by pbu

  • find_by_reference(references) - retrieves content associated with the provided reference ID (e.g. demo1). This maps to the references declared by the embedding of the frontend module @frappy/react-content
  • find_by_reference_and_content_type(references, content_type) - similar to find_by_reference, this additionally filters by content type as well. Content types are also declared by the embedding of the frontend module.
  • update_content(content_id, label, references, content) - this is a complete update of the data (except for the content type, which shouldn't change with regular updates). This will completely replace a content objects label, reference assignment and the entire content (provided as list or dict, depending on the type of content (declared in the embedding of the frontend module)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

frappymongocontent-1.0.1.tar.gz (2.4 kB view details)

Uploaded Source

Built Distribution

frappymongocontent-1.0.1-py3-none-any.whl (6.9 kB view details)

Uploaded Python 3

File details

Details for the file frappymongocontent-1.0.1.tar.gz.

File metadata

  • Download URL: frappymongocontent-1.0.1.tar.gz
  • Upload date:
  • Size: 2.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/51.1.0 requests-toolbelt/0.9.1 tqdm/4.58.0 CPython/3.8.12

File hashes

Hashes for frappymongocontent-1.0.1.tar.gz
Algorithm Hash digest
SHA256 14f6167b8890a2b7a65f1956f6f5c8ec4524d41c7391ddd01807e75f3eff46e7
MD5 9f4dee57c12a5e344fcfdcdf62777761
BLAKE2b-256 aa3d8f1ab9c5067d85feeed76de2147ac7ebf22467704642ae492fbb0e0df47c

See more details on using hashes here.

File details

Details for the file frappymongocontent-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: frappymongocontent-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 6.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/51.1.0 requests-toolbelt/0.9.1 tqdm/4.58.0 CPython/3.8.12

File hashes

Hashes for frappymongocontent-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 39e7dcc5141da6b9b76b44786b09255badc0cf1afbab41f4ff493e718f6d1a03
MD5 5ef3459bbb005bdb750be8331c373c21
BLAKE2b-256 2293a0788e3c1669820882e9449fa91138a76ee81f62d4d5f423f2c0e531b45a

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page