Source

gnocchi-ask / docs / INSTALL

The default branch has multiple heads

# INSTALL

Installation is simply done using pip:

    pip install gnocchi-ask.tar.gz

Pre-requisites:

Obviously, it depends on Django, and also django-taggit for tagging.

Then, add it to your installed apps:

    INSTALLED_APPS = [
        ...
        'gnocchi.ask',
        'django-taggit',
    ]

and syncdb.

There are 3 templates required:

- gnocchi_ask/question_list.html

    The main view page.  This is implemented using an "object_list" generic
    view.  Pagination is set by default at 10, adjustable with the QUESTION_PAGE
    setting.

- gnocchi_ask/question_detail.html

    View of a question.  Since this uses the "object_detail" generic view, the
    selected question is in the context as "object".

    Also in context is an AddResponseForm form, as 'form',

- gnocchi_ask/question_ask.html

    Used for entering a new question.


## Models

Question:
    user
    question
    content
    created
    accepted ->[response]
    visible:    Boolean

    tags:       Taggit TagManager

    votes():    Returns the number of votes for Responses to this question.

The default manager is a VisibleManager, which adds visible(), returning only
objects with visible=True.


Response:
    user:       Who posted the response
    question:   The question the response is for
    created:    Date/Time of when response was posted
    content:    Text of the response
    visible:    Moderation flag

    vote_up_url():      URL to vote this response up
    vote_down_url():    URL to vote this response down
    get_accept_url():   URL to accept this response to the question
    score():            Returns the sum of vote points for this response

The default manager is a VisibleManager, with a customised default annotation
adding 'score', and ordering by scores (descending) and created.
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.