Beispiel #1
0
def create(request):
    if request.POST:
        form = statusForm(request.POST)
        if form.is_valid():
            c = form.save(commit=False)
            c.user1 = request.user.username
            c.save()
            return HttpResponseRedirect('/accounts/loggedin')
    else:
        form = statusForm()
    args = {}
    args['form'] = form
    return render_to_response('create_form.html', args)  # might be wrong
Beispiel #2
0
def create(request):
    if request.POST:
        form = statusForm(request.POST)
        if form.is_valid():
            c = form.save(commit=False)
            c.user1 = request.user.username
            c.save()
            return HttpResponseRedirect("/accounts/loggedin")
    else:
        form = statusForm()
    args = {}
    args["form"] = form
    return render_to_response("create_form.html", args)  # might be wrong
Beispiel #3
0
def loggedin(request):
	if request.user == AnonymousUser():
			return HttpResponseRedirect('/accounts/login/')
	
	return render_to_response('dashboard.html',{
			'form':statusForm(),
			'status' : status1.objects.all().order_by('-syear')[:3],
			'asg2': asgmnt1.objects.filter(assignment = True).order_by('doi'),		
			'date1' :date.today(),
			'hits': newuser.objects.filter(user = request.user)[0],
			'files':upoad1.objects.all(),
			'full_name' : request.user.username,
	 		'status2' : status1.objects.all().order_by('-syear')}
	)# might be wrong