def get_context_data(self, **kwargs): resp = twilio.twiml.Response() if 'RecordingUrl' in self.request.GET and str(int(self.request.REQUEST['From'][1:])) == self.request.REQUEST['From'][1:]: Note.makeForUser(self.request.REQUEST['From'][1:], self.request.REQUEST['RecordingUrl'], self.request.REQUEST['RecordingSid']) with resp.gather(numDigits=1, action="/handle_share/", method="GET") as g: g.say("""Press 1 to share the note with a friend. Press any other key to quit.""") else: resp.say("An error occurred.") return {'xml': str(resp)}
def get_context_data(self, **kwargs): if'TranscriptionText' in self.request.REQUEST: note = Note.getForUser(Profile.getUserByPhone(self.request.REQUEST['From'][1:])).order_by('-id')[0] logger.error(self.request.REQUEST['TranscriptionText']) for user in User.objects.all(): if user.first_name + " " + user.last_name == self.request.REQUEST['TranscriptionText']: logger.error('match!') note.shares.add(user) return {'xml':""}
def get_context_data(self, **kwargs): if 'RecordingSid' in self.request.REQUEST and 'TranscriptionText' in self.request.REQUEST: Note.addTranscription(self.request.REQUEST['RecordingSid'], self.request.REQUEST['TranscriptionText']) return {'xml':""}