コード例 #1
0
def create_dupla(request, id, graph):
	context = RequestContext(request)
	resolve = connect(request, graph)

	user = request.user
	user_dois = User.objects.get(id=id)
	if not Group.group.get_group_user(request.user):
		Group.group.create_pair(request.user, user_dois)

	return HttpResponseRedirect(reverse('perfil'))
コード例 #2
0
def dupla(request, graph):
	context = RequestContext(request)
	resolve = connect(request, graph)
	# user = request.user
	if not request.user.is_teacher:
		context['users'] = get_user_sem_dupla()

	context['g'] = graph

	return render_to_response('list_users.html', context)
コード例 #3
0
def home(request, graph):
	context = RequestContext(request)
	resolve = connect(request, graph)

	# if not request.user.is_teacher:
	context['discussions'] = get_discussions_user_comment(request.user).order_by('-date_create')
	context['discussions_theme'] = Discussion.discussion.get_is_discussion_theme(True).order_by('-date_create')


	context['g'] = graph

	return render_to_response('home.html', context)
コード例 #4
0
def perfil(request, graph):
	context = RequestContext(request)
	resolve = connect(request, graph)
	user = request.user
	if not request.user.is_teacher:
		context['discussions'] = get_discussions_user_comment(request.user).order_by('-date_create')
		context['notificacoes'] = Mural.mural.all()
		context['group'] = get_user_group(user)
	#else:

	context['g'] = graph

	return render_to_response('perfil.html', context)