Ejemplo n.º 1
0
def show(interest_id, id):
    form = ConversationShowForm(url={'interest_id':interest_id, 'id':id})
    if not form.validate():
        return json({'message': 'Validation Failed', 'errors': form.errors}, 422)

    data = Conversation.find(form.interest_id, form.id)
    if data is not False:
        return json(data)
    else:
        return json({'message': 'Conversation with given ID not found'}, 404)
Ejemplo n.º 2
0
def show(interest_id, id):
    form = ConversationShowForm(url={'interest_id': interest_id, 'id': id})
    if not form.validate():
        return json({
            'message': 'Validation Failed',
            'errors': form.errors
        }, 422)

    data = Conversation.find(form.interest_id, form.id)
    if data is not False:
        return json(data)
    else:
        return json({'message': 'Conversation with given ID not found'}, 404)
Ejemplo n.º 3
0
 def testFind(self):
     obj = Conversation.find(1, 1)
     self.assertTrue(isinstance(obj, Conversation))
     self.assertTrue(is_integer(obj.id))