Skip to main content

Allows the creation of custom questionnaires and surveys via the Django admin.

Project description

# incuna-surveys
Allows the creation of custom questionnaires and surveys via the admin.

# Usage

## Frontend

To set the `apiRoot` use `ProjectConfigProvider.setApiRoot()`

## Backend

### Admin

Create an `admin.py` with the following content:

```python
from django.contrib import admin
from surveys.base_admin import (
SurveyAdmin,
SurveyFieldAdmin,
SurveyFieldOrderingAdmin,
SurveyFieldsetAdmin,
SurveyFieldsetOrderingAdmin,
UserResponseAdmin,
)
from surveys.models import (
Survey,
SurveyField,
SurveyFieldOrdering,
SurveyFieldset,
SurveyFieldsetOrdering,
UserResponse,
)

admin.site.register(models.SurveyField, SurveyFieldAdmin)
admin.site.register(models.SurveyFieldset, SurveyFieldsetAdmin)
admin.site.register(models.Survey, SurveyAdmin)
admin.site.register(models.SurveyFieldOrdering, SurveyFieldOrderingAdmin)
admin.site.register(models.SurveyFieldsetOrdering, SurveyFieldsetOrderingAdmin)
admin.site.register(models.UserResponse, UserResponseAdmin)
```

# Development

## Frontend

All frontend is located under `web/`:

* `npm install` to install requirements
* `bower install` to install dependencies
* `grunt test` to test if everything is working properly
* `grunt` will start a dev server running under `localhost:9000`.

This project uses `babel` and `browserify`. Source files are located in `web/app/scripts/src`. Compiled files are put into `web/dist`, which is symlinked to `web/app/scripts/js-build` for easy testing in the browser.

### Tests

The are two `grunt karma` targets:
* `grunt karma:dev` once run will continue to watch the compiled `.js` files directory and the test files.
* `grunt karma:ci` target only runs once. This target is also used in Travis

## Releasing a new version

1. Commit your changes.
1. Follow the guidelines at http://semver.org/ to determine your new version number.
1. Update `CHANGELOG.md` with your new version number and a description of changes.
1. Update the `version` property in `package.json`
1. Update the `version` property in `setup.py`
1. Commit those changes with the commit message "Bump to [version number]". [version number] should be in the format x.y.z.
1. `git tag [version number]`
1. `git push`
1. `git push --tags` - must be done separately.
1. Run `make release` to publish the release to pypi

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

incuna-surveys-0.7.0.tar.gz (18.9 kB view details)

Uploaded Source

Built Distribution

incuna_surveys-0.7.0-py2.py3-none-any.whl (29.8 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file incuna-surveys-0.7.0.tar.gz.

File metadata

File hashes

Hashes for incuna-surveys-0.7.0.tar.gz
Algorithm Hash digest
SHA256 9a589f1157363aab28c859be6f9379e21918b78a5aa66daf88d2ca26e9e967a4
MD5 b751f345b8edc86ff1f191fb4140626c
BLAKE2b-256 14ab2b437c3b712edbcc8098a3e35a4b22518ac59a74384fb120d6076cad2bc4

See more details on using hashes here.

File details

Details for the file incuna_surveys-0.7.0-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for incuna_surveys-0.7.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 88a6329943f2f583886954b896d1d30ffa160222e6d132a00bc7c7237133db73
MD5 bca296c140e6bd4af84ec8ab6a5f339c
BLAKE2b-256 0e13ae8c9d3e6cb4278e3a610a90083231311c4138b4bb131d88de83f9356a81

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