This release is a pre-release and may not be stable for production use.
=======
A portable application to easily associate a user valuation (rating, like etc)
to any object, just on the basis of template tags. No configuration of existing
models and views required.
Installation
============
- Run `python setup.py install`
- Include 'valuate' in your installed apps settings.
- Add `(r'^valuate/', include('valuate.urls'))` to your main urls.py.
- Ensure you have request context preprocessor added in the list of preprocessors
or pass request varible context to views.
Usage
=====
**Available settings:**
`VALUATION_NAME`: Name for the type of valuation, will be visible in forms.
Eg: rating,like etc.
`VALUATION_CHOICES`: A list of choices which will be used as the choice set for users.
Each choice will be assigned an integer value, going from low to high.
Eg: `['low', 'medium', 'high']` => `((1, 'low'), (2, 'medium'), (3, 'high'))`
`VALUATION_TEMPLATE`: Name of a predefined template.
Currently available: rating, like.
Load the template tags: `{% load valuation %}`
**Available tags:**
{% render_valuation_form object %}
----------------------------------
Renders the valuation form for the provided object.
Override template: 'valuate/form.html' for modifying the look.
{% render_valuation_status object %}
------------------------------------
Renders the status according to the score of various choices.
Override template: 'valuate/status.html' for modifying the look.
{% get_valuation_ajax_fields object 'as_name' %}
----------------------------------------------
Adds the fields as dictionary required for an ajax post request to
the context with variable name `as_var` provided as a string.
Variables available:
For post request: 'content_type','object_pk', 'value' (to be selected
by user, can have an initial value if user has already submitted once)
'choices': dictionary of choices for user to provide the 'value' data.
'target': target for the request.
On a successfull request, true will be retuned.
If you are not using a popular javascript liberary, pass on a POST
variable with name `ajax` and a `true` value.
{% get_valuation_form object 'as_name' %}
---------------------------------------
Adds the valuation form to the context with variable name as_var
provided as a string.
User `form_name.target` to access the target for the post request.
{% get_valuation_score object %}
--------------------------------
Returns the average score of the object using the corresponding values
of chioces.
{% get_choice_count object 'choice' %}
--------------------------------------
Returns the score count for a perticular choice of an object. Choice
should be provided with quotes (as string).
Metadata
Release files for django-valuate 1.0-beta
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| django-valuate-1.0-beta.tar.gz | 8.6 kB | Without provenance | Details for django-valuate-1.0-beta.tar.gz |
Release files / django-valuate-1.0-beta.tar.gz
| Download URL | django-valuate-1.0-beta.tar.gz |
|---|---|
| Size | 8.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
529ddd56bdd0654d291dab55e80782c470274c88b2618aac40ba8b38e45a2f5c
|
|
BLAKE2b-256 checksum How to use checksums |
6e1489a7eef5273e91765c7f72515c2d032192028d01adb6f1cb0f11bb44c177
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for django-valuate 1.0-beta
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.