QnA Model#
path: /qna/models.py. Keeping qna and record of coach taking qna
Models#
QNA model#
each entry is one posts
content_typeindicates whether an entry is Q&A or Editorialprediction,assignment=> related to meta.Categorytag=> many-to-many related to meta.QNATagasked_by(user),answer_by(coach) => related to user.User (if content_type == Editorial, asked_by will be null)alias=> unique for querying postsapproved_questionindicates whether a QNA is valid for coach to answer. If user asked QNA without quota,approved_questionwill befalseand the question will not be seen by coachpublishedindicates whether a question is public.truewhen the QNA is answered by a coachapproved questionandpublishedwill betruewhen it is an editorial
QNAOrder model#
qna=> related to qna.QNAcoach=> related to user.Userstatus=> 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