Exemplo n.º 1
0
def tweets(request):
    user = User.objects.get(username=request.user.username)

    t = Tweets.objects.order_by('-datetime').filter(user=user)
    form = TweetForm()

    return render_page('tweets.html', {'tweets': t, 'form': form}, request)
Exemplo n.º 2
0
def users(request):
	if not request.user.is_superuser:
		params = urlencode({'error': 'You are not permitted to access the admin features.'})
		return HttpResponseRedirect('/?' + params)

	data = {}

	u = User.objects.filter(is_superuser=0)
	data['users'] = u

	return render_page('users.html', data, request)
Exemplo n.º 3
0
def dashboard(request):
    if not request.user.is_staff:
        params = urlencode(
            {'error': 'You are not permitted to access the admin features.'})
        return HttpResponseRedirect('/?' + params)

    data = {}

    t = Tweets.objects.filter(status=0)
    data['pending'] = len(t)

    return render_page('dashboard.html', data, request)
Exemplo n.º 4
0
def users(request):
    if not request.user.is_superuser:
        params = urlencode(
            {'error': 'You are not permitted to access the admin features.'})
        return HttpResponseRedirect('/?' + params)

    data = {}

    u = User.objects.filter(is_superuser=0)
    data['users'] = u

    return render_page('users.html', data, request)