QnA Model#

path: /qna/models.py. Keeping qna and record of coach taking qna

Models#

QNA model#

each entry is one posts

  • content_type indicates whether an entry is Q&A or Editorial

  • prediction, assignment => related to meta.Category

  • tag => many-to-many related to meta.QNATag

  • asked_by (user), answer_by (coach) => related to user.User (if content_type == Editorial, asked_by will be null)

  • alias => unique for querying posts

  • approved_question indicates whether a QNA is valid for coach to answer. If user asked QNA without quota, approved_question will be false and the question will not be seen by coach

  • published indicates whether a question is public. true when the QNA is answered by a coach

  • approved question and published will be true when it is an editorial

QNAOrder model#

  • qna => related to qna.QNA

  • coach => related to user.User

  • status => string

Value

Description

Meaning

PD

Pending (default)

the coach has taken the QNA but not answered yet

CP

Completed

the coach answered the QNA

CL

Cancelled

the coach cancelled the order or the order expired

a crontab is set to check all pending QNAOrder for every two hours. Any expired order will be set cancelled automatically

expiry time: 1 day