def create_respondant(self, vendor, fishes, market=None, status=None, when=None): if when is None: when = datetime.datetime.utcnow().replace(tzinfo=utc) respondant = Respondant(survey=self.survey, ts=when, surveyor=self.user) if status is not None: respondant.review_status = status respondant.save() if market is not None: response_market = self.create_text_response(self.question_market, respondant, when, market) respondant.response_set.add(response_market) response_vendor = self.create_text_response(self.question_vendor, respondant, when, vendor) respondant.response_set.add(response_vendor) response_fishes = self.create_multi_select_response(self.question_fishes, respondant, when, fishes) respondant.response_set.add(response_fishes) respondant.save() return respondant
def create_respondant(self, vendor, fishes, market=None, status=None, when=None): if when is None: when = datetime.datetime.utcnow().replace(tzinfo=utc) respondant = Respondant(survey=self.survey, ts=when, surveyor=self.user) if status is not None: respondant.review_status = status respondant.save() if market is not None: response_market = self.create_text_response( self.question_market, respondant, when, market) respondant.response_set.add(response_market) response_vendor = self.create_text_response(self.question_vendor, respondant, when, vendor) respondant.response_set.add(response_vendor) response_fishes = self.create_multi_select_response( self.question_fishes, respondant, when, fishes) respondant.response_set.add(response_fishes) respondant.save() return respondant
def create_respondant(self, when, prices, market=None, status=None): respondant = Respondant(survey=self.survey, ts=when, surveyor=self.user) if status is not None: respondant.review_status = status respondant.save() grid_response = self.create_grid_response(self.question, respondant, when, prices) respondant.response_set.add(grid_response) if market is not None: market_response = self.create_text_response(self.market_question, respondant, when, market) respondant.response_set.add(market_response) respondant.save()
def create_respondant(self, when, prices, market=None, status=None): respondant = Respondant(survey=self.survey, ts=when, surveyor=self.user) if status is not None: respondant.review_status = status respondant.save() grid_response = self.create_grid_response(self.question, respondant, when, prices) respondant.response_set.add(grid_response) if market is not None: market_response = self.create_text_response( self.market_question, respondant, when, market) respondant.response_set.add(market_response) respondant.save()
def create_respondant(self, when, market, answers, status=None): respondant = Respondant(survey=self.survey, ts=when, surveyor=self.user) if status is not None: respondant.review_status = status respondant.save() response_a = self.create_text_response(self.question_a, respondant, when, market) respondant.response_set.add(response_a) response_b = self.create_multi_select_response(self.question_b, respondant, when, answers) respondant.response_set.add(response_b) respondant.save() return respondant
def create_respondant(self, when, market, answers, status=None): respondant = Respondant(survey=self.survey, ts=when, surveyor=self.user) if status is not None: respondant.review_status = status respondant.save() response_a = self.create_text_response(self.question_a, respondant, when, market) respondant.response_set.add(response_a) response_b = self.create_multi_select_response(self.question_b, respondant, when, answers) respondant.response_set.add(response_b) respondant.save() return respondant