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


Release history Release notifications

Download files

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

Files for etools-offline, version 0.1.0
Filename, size File type Python version Upload date Hashes
Filename, size etools_offline-0.1.0-py2.py3-none-any.whl (18.1 kB) File type Wheel Python version py2.py3 Upload date Hashes View
Filename, size etools_offline-0.1.0.tar.gz (19.0 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page