Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- try:
- tweet = twitter.Api(username='mgit_toms', password='t0mst0mst0ms')
- statuses = tweet.GetUserTimeline('mgit_toms')
- except Exception:
- twit = 0
- linux_total = device.objects.filter(groups__in = [1]).count()
- win_total = device.objects.filter(groups__in = [2]).count()
- han_total = device.objects.filter(location = 2).count()
- ric_total = device.objects.filter(location = 1).count()
- bdot_total = device.objects.filter(location = 4).count()
- dt_total = device.objects.filter(location = 3).count()
- rack_total = device.objects.filter(location = 5).count()
- rackdr_total = device.objects.filter(location = 5).count()
- fcg_total = device.objects.filter(location = 8).count()
- if twit:
- return render_to_response('index.html', { 'loc_list': loc_list, 'statuses': statuses[:5], 'linux_total': linux_total, 'win_total': win_total, 'han_total': han_total, 'ric_total': ric_total, 'bdot_total': bdot_total, 'dt_total': dt_total, 'rack_total': rack_total, 'rackdr_total': rackdr_total, 'fcg_total': fcg_total }, context_instance=RequestContext(request))
- else:
- return render_to_response('index.html', { 'loc_list': loc_list, 'linux_total': linux_total, 'win_total': win_total, 'han_total': han_total, 'ric_total': ric_total, 'bdot_total': bdot_total, 'dt_total': dt_total, 'rack_total': rack_total, 'rackdr_total': rackdr_total, 'fcg_total': fcg_total }, context_instance=RequestContext(request))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement