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
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
Release history Release notifications | RSS feed
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.2.0.tar.gz
(18.0 kB
view details)
Built Distribution
File details
Details for the file incuna-surveys-0.2.0.tar.gz
.
File metadata
- Download URL: incuna-surveys-0.2.0.tar.gz
- Upload date:
- Size: 18.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0d85084ab0bb1fd832609bbc7ec4cf9f3787748e9a459e8d1b3aad4ee90ffb48 |
|
MD5 | 625d0330a4f394d11efc8be6bc99e00a |
|
BLAKE2b-256 | 0037d6d860e1d4c0cee49598cda3e2f26323841dcde8a1cd70e5e328d43d0bd4 |
File details
Details for the file incuna_surveys-0.2.0-py2.py3-none-any.whl
.
File metadata
- Download URL: incuna_surveys-0.2.0-py2.py3-none-any.whl
- Upload date:
- Size: 28.6 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a10985baa6e12c5673ae264d0bea0d2d9fb8a60434f3ff12df57eab1bb85c971 |
|
MD5 | ef0e72501af190988e3c94eea41ad6f3 |
|
BLAKE2b-256 | 39faebd06c49d77c4e6c333dfa437a8df81e7f60687ac8f7aaa7a09797269314 |