Exemplo n.º 1
0
def view(request, slug):
    api = CSEAPI()
    user = api.get_user_by_slug(slug)
    flows = api.get_nodes('flow', { 'author_id': user.id, 'status': 1 })
    boards = api.get_nodes('board', { 'author_id': user.id, 'status': 1 })

    payload = {
        'user': user,
        'flows': flows,
        'boards': boards,
    }

    return render_to_response('user/view.html', payload, context_instance=RequestContext(request))
Exemplo n.º 2
0
    def test_get_user_by_slug(self):
        api = CSEAPI()

        user = api.get_user_by_slug('users/root')
        self.assertIsInstance(user, User)
        self.assertIsInstance(user.id, int)
Exemplo n.º 3
0
    def test_get_user_by_slug(self):
        api = CSEAPI()

        user = api.get_user_by_slug('users/root')
        self.assertIsInstance(user, User)
        self.assertIsInstance(user.id, int)