Settings — django-critic v0.2.1 documentation

django-critic v0.2.1 documentation

# Settings

- Table of Contents
- index
  next
  previous

# Settings

Contents

- Settings
  - CRITIC_RATING_METHODS
  - CRITIC_ALLOW_CHANGE
  - CRITIC_DEFAULT_RENDER_TEMPLATE
  - CRITIC_RATING_ATTRIBUTE

Below is a list of all the settings variables.

## CRITIC_RATING_METHODS

This setting is a list of dictionaries that defines all the properties of your rating methods.

Example:

    CRITIC_RATING_METHODS = (
            {'name': 'A Simple Up/Down Rating System',
             'content_types': ['blog.entry'],
             'options': [0, 1],
             'allow_change': True
            },
    )

### Module Keys

- name - String, Optional, this is a generic name so you can identify the rating method.

- content_types - this is a list of the models you wish to have be ratable.
    - Format expected is ‘app.model’.

- options - This is a list of Integers of all the options a user can select.

- allow_change - True|False, Optional, will allow user to change their rating
    - If not specified CRITIC_ALLOW_CHANGE will be used.
- template - String, location of the template to use for the content_types.
    - If not specified CRITIC_DEFAULT_RENDER_TEMPLATE will be used.

## CRITIC_ALLOW_CHANGE

True|False, used as a default value to determine if a user can change their rating for a object.

## CRITIC_DEFAULT_RENDER_TEMPLATE

The location of the default template. Default location is ‘critic/render.html’

## CRITIC_RATING_ATTRIBUTE

The name of the attribute that will be added to the object for easy access to the ratings