NewsBlur/apps/monitor/views/newsblur_stories.py

22 lines
639 B
Python
Executable file

from django.views import View
from django.shortcuts import render
from apps.rss_feeds.models import MStory, MStarredStory
from apps.rss_feeds.models import MStory, MStarredStory
class Stories(View):
def get(self, request):
data = {
'stories': MStory.objects.count(),
'starred_stories': MStarredStory.objects.count(),
}
chart_name = "stories"
chart_type = "histogram"
context = {
"data": data,
"chart_name": chart_name,
"chart_type": chart_type,
}
return render(request, 'monitor/prometheus_data.html', context)