Skip to main content

Managing subjects in a human research context.

Project description

huscy.subjects

PyPi Version PyPi Status PyPI Downloads PyPI License Python Versions Django Versions

Requirements

  • Python 3.6+
  • A supported version of Django

Tox tests on Django versions 2.1, 2.2, 3.0 and 3.1.

Installation

To install husy.subjects simply run:

pip install huscy.subjects

Configuration

First of all, the huscy.subjects application has to be hooked into the project.

  1. Add huscy.subjects and further required apps to INSTALLED_APPS in settings module:
INSTALLED_APPS = (
	...
	'django_countries',
	'phonenumber_field',
	'rest_framework',
	'rest_framework_nested',

	'huscy.subjects',
)
  1. Create huscy.subjects database tables by running:
python manage.py migrate

REST-Endpoints

URL HTTP Method Description
/api/subjects/ GET Returns 500 subjects, paginated by 25 items per page and ordered by contact__last_name and contact__first_name.
                                                  |             | Additional get parameter allowed:
                                                  |             | - `count=<items_per_page>` - configure the items per page; max count is 100
                                                  |             | - `ordering=<field_name>` - comma separated list of fields. One can order by `contact__first_name`, `contact__last_name`, `contact__gender` or `contact__date_of_birth`
                                                  |             | - `page=<page>` - show results on page `page`
                                                  |             | - `serach=<query_string>` - search for `display_name` or `date_of_birth`

/api/subjects/<subject_id>/guardians/ | POST | Create new contact and add as guardian to subject. /api/subjects/<subject_id>/guardians/<guardian_id>/ | DELETE | Removes the guardian for subject. /api/subjects/<subject_id>/notes/ | GET | Returns the list of all notes for subject. /api/subjects/<subject_id>/notes/ | POST | Create new note about subject. Other option should be chosen to save comment. /api/subjects/<subject_id>/notes/<note_id>/ | DELETE | Removes the note about subject /api/subjects/<subject_id>/inactivity/ | DELETE | Removes inactivity for subject. | POST | Creates or updates the inactivity for a subject.

Development

After checking out the repository you should activate any virtual environment. Install all development and test dependencies:

make install

Create migration files and database tables:

make makemigrations
make migrate

We assume you're having a running postgres database with a user huscy and a database also called huscy. You can easily create them by running

sudo -u postgres createuser -d huscy
sudo -u postgres psql -c "GRANT ALL PRIVILEGES ON DATABASE huscy TO huscy;"
sudo -u postgres psql -c "ALTER USER huscy WITH PASSWORD '123';"
sudo -u postgres createdb huscy

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

huscy.subjects-0.8.0rc17.tar.gz (17.0 kB view details)

Uploaded Source

Built Distribution

huscy.subjects-0.8.0rc17-py3-none-any.whl (38.6 kB view details)

Uploaded Python 3

File details

Details for the file huscy.subjects-0.8.0rc17.tar.gz.

File metadata

  • Download URL: huscy.subjects-0.8.0rc17.tar.gz
  • Upload date:
  • Size: 17.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.6.9

File hashes

Hashes for huscy.subjects-0.8.0rc17.tar.gz
Algorithm Hash digest
SHA256 5ca17b239861ed147689f52e8d210542a7e0f1f7fc28cb7d9cfd91e9e5843bee
MD5 72d2e652fd8e618b0e762af6355f40bb
BLAKE2b-256 c2f8c89787f704e575c9394a8fd89d08a7f0c4e6b83d528e45efe0478b723095

See more details on using hashes here.

File details

Details for the file huscy.subjects-0.8.0rc17-py3-none-any.whl.

File metadata

  • Download URL: huscy.subjects-0.8.0rc17-py3-none-any.whl
  • Upload date:
  • Size: 38.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.6.9

File hashes

Hashes for huscy.subjects-0.8.0rc17-py3-none-any.whl
Algorithm Hash digest
SHA256 42bc86d00e92eb060542115e54aa68df255963017c8f77f264a8e74afab7787d
MD5 989361f7771c86d66707f9f85c995727
BLAKE2b-256 5d79fb80429f9d14200c6c7985e82835d5648aeef1acd74a04232bce4f139b23

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