Skip to main content

eTools Offline Collect application

Project description

eTools Offline Collect makes use of unicef_attachments to handle the files.

Installation

$ pip install etools-offline

Setup

Add etools_offline to INSTALLED_APPS in settings

INSTALLED_APPS = (
  ...
  'etools_offline',

)

Set eTools Offline API settings;

ETOOLS_OFFLINE_API = "http://localhost:8000/api/remote/blueprint/"
ETOOLS_OFFLINE_TOKEN = "123"

Usage

Hooks happen in serializers, so update relevant serializers;

from etools_offline import OfflineCollect

# add new blueprint
OfflineCollect().add(data={
    "code": "blueprint-123",
    "form_title": "Blueprint 123",
    "form_instructions": json.dumps({"key": "value"}),
    "accessible_by": ["joe@example.com", "mary@example.com"],
    "api_response_url": "http://example.com/response/",
})

response = {
    'id': 88,
    'code':
    'blueprint-123',
    'form_title': 'Blueprint 123',
    'form_instructions': {'key': 'value'},
    'is_active': False,
    'accessible_by': ['joe@example.com', 'mary@example.com'],
    'expiry_date': '2021-02-18',
    'max_forms_allowed': None,
    'api_response_url': 'http://example.com/response/',
    'created': '2020-02-19T15:41:10.016068Z',
    'modified': '2020-02-19T15:41:10.016094Z'
}

# update blueprint
OfflineCollect().update(
  accessible_by="<accessible_by>",
  expiry_date="<expiry_date>",
)

# get list of blueprints
OfflineCollect().list()

# get specific blueprint
OfflineCollect().get(<code>)

# delete blueprint
OfflineCollect().delete(<code>)

Contributing

Configure development environment

$ make develop

Run tests

$ make test

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

etools_offline-0.1.0.tar.gz (19.0 kB view details)

Uploaded Source

Built Distribution

etools_offline-0.1.0-py2.py3-none-any.whl (18.1 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file etools_offline-0.1.0.tar.gz.

File metadata

  • Download URL: etools_offline-0.1.0.tar.gz
  • Upload date:
  • Size: 19.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.8.1

File hashes

Hashes for etools_offline-0.1.0.tar.gz
Algorithm Hash digest
SHA256 a552bf9d7be3593f2492c2fef08cc34c89b2d2bc46c0a8899547baf718712804
MD5 c86f483262f8bb3cb29eac9216b4fc8a
BLAKE2b-256 db90bfeb3e84ce1140d166460e373dd866fa20a6375ea9b69f0563f8e9d1ba0c

See more details on using hashes here.

File details

Details for the file etools_offline-0.1.0-py2.py3-none-any.whl.

File metadata

  • Download URL: etools_offline-0.1.0-py2.py3-none-any.whl
  • Upload date:
  • Size: 18.1 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.8.1

File hashes

Hashes for etools_offline-0.1.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 e6b2e337d80f417175a1f2afa16910c90f8f8cd8abc7442f852b8898c5ed8f47
MD5 d1212b2366dab8ecbc93eceedc7d5f74
BLAKE2b-256 7dfa38e06085fec4bd96869953763fa3deb3e1df562376c4572b907309e64498

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