Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(5)  |  Call(4)  |  Derive(0)  |  Import(1)

src/q/u/quanda-HEAD/views/__init__.py   quanda(Download)
 
import quanda.models
from quanda.forms import QuestionForm, QuestionTagForm, QuestionListForm, QuestionListOrderForm, QuestionListAddForm, AnswerForm, RepForm, ProfileForm, CommentForm
from quanda.models import Question, QuestionVote, QuestionTag, QuestionList, QuestionListOrder, QuestionView, Answer, AnswerVote, Profile, Comment
from quanda.utils import get_user_rep
def lists(request):
    if not request.user.is_staff: return HttpResponse("Unauthorized")
    if request.method == 'POST':
        form = QuestionListForm(request.POST)
        if form.is_valid():
            list = form.save()
            return HttpResponseRedirect(reverse('quanda_lists'))
    else:
        form = QuestionListForm()
    questions_list = QuestionListOrder.objects.filter(question_list=list).order_by('order')
 
    edit_form = QuestionListForm(instance=list)
    add_question_form = QuestionListAddForm(list)
    invalid_count = False
    if request.method == "POST":
 
        if request.POST.has_key('edit_list'):
            edit_form = QuestionListForm(request.POST, instance=list)