Giter Club home page Giter Club logo

django-valuate's Introduction

Valuate
=======
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
=====
Create a valuation type from admin site.   
Let us say: 
**Rating**

 - Excellent  5
 - Good       4
 - Average    3
 - Bad        2
 - Poor       1

or  

**LikeDislike**

 - Like       1
 - Dislike    0
 
 
**Available settings:**  

`DEFAULT_VALUATION_TYPE_ID`: The ID of default valuation type to be used in the project
Load the template tags: `{% load valuation %}`
 
**Available tags:**  

{% render_valuate form  of object for valuation_type %}
------------------------------------------------------
Renders the valuation form for the provided object.  
Override template: 'valuate/form.html' for modifying the look.

{% render_valuate form of object for valuation_type %}
---------------------------------------------------------
Renders the status according to the score of various choices.   
Override template: 'valuate/status.html' for modifying the look.

{% get_valuate ajax_fields of object for valuation_type as variable %}
---------------------------------------------------------------------
Get the fields as dictionary required for an ajax post request in the context
or directly.
Variables available:
For post request: 'content_type','object_pk', 'choice' (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.
'vtype'": the valuation type. 
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_valuate form of object for valuation_type as variable %}
--------------------------------------------------------------
Gets the valuation form in context or directly.
User `form_name.target` to access the target for the post request.

{% get_valuate score of object for valuation_type as variable %}
-----------------------------------------------------
The average score of the object using the corresponding values
of chioces.

{% get_valuate choice_count of object for_chioce choice_name for valuation_type as variable %}
----------------------------------------------------------------------------------------------
Returns the score count for a perticular choice of an object. Choice
should be provided with quotes (as string).

*The `for valuation_type` and `as variable` are optional arguments*

And Thats it!

django-valuate's People

Stargazers

 avatar

Watchers

 avatar  avatar

django-valuate's Issues

Ilegal print statement in templatetags/valuation.py on mod_wsgi

What steps will reproduce the problem?
On line 37 in templatetags/valuation.py there is an print statement:
print 'called' which is not allowed when using mod_wsgi.

What is the expected output? What do you see instead?
An exception

What version of the product are you using? On what operating system?
1.0-beta

Please provide any additional information below.

Original issue reported on code.google.com by [email protected] on 4 Mar 2011 at 1:23

Fixed through separate models for valuation type and choices.

The choices for a valuation are global (through settings file) while it should 
be configurable on model basis.  

Best possible solution:  
Provision for custom variable in __init__'s of valuation model and form to  
customizing the choice set

Original issue reported on code.google.com by rohanjain.kgp on 14 Feb 2011 at 11:35

Wrong migrations

The migrations causes problems on a clean install.

For example: 0001_initial.py and 0002_initial.py try to install the same 
table(s) wich causes south to error out.

Original issue reported on code.google.com by [email protected] on 2 Mar 2012 at 1:36

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.