示例#1
0
    def save(self, commit=True):

        # 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
            askBase = AskBase(customQuestion=self.customQuestion, user=askedUser)
            askBase.isAccepted = False
            askBase.save()
示例#2
0
    def save(self, commit=True):

        #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
            askBase = AskBase(customQuestion=self.customQuestion,
                              user=askedUser)
            askBase.isAccepted = False
            askBase.save()
示例#3
0
def createAskBasesForUsers(users, userWhoAsked, customQuestion):

    for user in users:
        askBase = AskBase(customQuestion=customQuestion, user=user)
        if userWhoAsked.pk == user.pk:
            askBase.isAccepted = True
        else:
            askBase.isAccepted = False

        #print "creating ask base for %s for question %s" % (user.username, customQuestion.question)
        askBase.save()
示例#4
0
def createAskBasesForUsers(users, userWhoAsked, customQuestion):

    for user in users:
        askBase = AskBase(customQuestion=customQuestion, user=user)
        if userWhoAsked.pk == user.pk:
            askBase.isAccepted = True
        else:
            askBase.isAccepted = False

        #print "creating ask base for %s for question %s" % (user.username, customQuestion.question)
        askBase.save()
示例#5
0
def registerNewUserToAllCandidateQuestions(user):
    for customQuestion in CustomQuestion.objects.all():
        if customQuestion.creator.groups.filter(name='Candidate').exists():
            askBase = AskBase(customQuestion=customQuestion, user=user)
            askBase.isAccepted = False
            askBase.save()
示例#6
0
def registerNewUserToAllCandidateQuestions(user):
    for customQuestion in CustomQuestion.objects.all():
        if customQuestion.creator.groups.filter(name='Candidate').exists():
            askBase = AskBase(customQuestion=customQuestion, user=user)
            askBase.isAccepted = False
            askBase.save()