예제 #1
0
    def save(self, user, commit=True):

        customQuestion = super(AskFormForCandidates, self).save(commit=False)
        customQuestion.creator = user
        customQuestion.question_type = Question.RADIO
        customQuestion.choices = "Agree, Partially Agree, Partially Disagree, Disagree, No Answer"
        customQuestion.save()

        createAskBasesForUsers(User.objects.all(), user, customQuestion)

        return customQuestion
예제 #2
0
    def save(self, user, commit=True):

        customQuestion = super(AskFormForCandidates, self).save(commit=False)
        customQuestion.creator = user
        customQuestion.question_type = Question.RADIO
        customQuestion.choices = 'Agree, Partially Agree, Partially Disagree, Disagree, No Answer'
        customQuestion.save()

        createAskBasesForUsers(User.objects.all(), user, customQuestion)

        return customQuestion
예제 #3
0
    def save(self, user, commit=True):

        customQuestion = super(AskFormForVoter, self).save(commit=False)
        customQuestion.creator = user
        customQuestion.question_type = Question.RADIO
        customQuestion.choices = "Agree, Partially Agree, Partially Disagree, Disagree, No Answer"
        customQuestion.save()

        # generate AskBases for asked user and include self
        askedUsers = self.cleaned_data["users_to_ask"]
        print "the following users have been asked:"
        for askedUser in askedUsers:
            print "username: %s" % askedUser.username

        usersToForwardQuestionTo = appendOwnUserToAskedUser(user, askedUsers)

        createAskBasesForUsers(usersToForwardQuestionTo, user, customQuestion)

        return customQuestion
예제 #4
0
    def save(self, user, commit=True):

        customQuestion = super(AskFormForVoter, self).save(commit=False)
        customQuestion.creator = user
        customQuestion.question_type = Question.RADIO
        customQuestion.choices = 'Agree, Partially Agree, Partially Disagree, Disagree, No Answer'
        customQuestion.save()

        #generate AskBases for asked user and include self
        askedUsers = self.cleaned_data['users_to_ask']
        print "the following users have been asked:"
        for askedUser in askedUsers:
            print "username: %s" % askedUser.username

        usersToForwardQuestionTo = appendOwnUserToAskedUser(user, askedUsers)

        createAskBasesForUsers(usersToForwardQuestionTo, user, customQuestion)

        return customQuestion