gnocchi-ask / docs / INSTALL

The default branch has multiple heads


Installation is simply done using pip:

    pip install gnocchi-ask.tar.gz


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

Then, add it to your installed apps:


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

- 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

    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.

    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.