Skip to content
Snippets Groups Projects
Commit 58b66f61 authored by Brian Moe's avatar Brian Moe
Browse files

Made max # of RSS feed items configurable in settings.

Set max in setting to 75 from previous default of 10.
Current default is 20, if not specified in settings.py
parent 8486f130
No related branches found
No related tags found
No related merge requests found
...@@ -10,6 +10,9 @@ from django.shortcuts import render_to_response ...@@ -10,6 +10,9 @@ from django.shortcuts import render_to_response
from models import Event, Group from models import Event, Group
from views import view, search, index from views import view, search, index
from django.conf import settings
FEED_MAX_RESULTS = getattr(settings, 'FEED_MAX_RESULTS', 20)
class EventFeed(Feed): class EventFeed(Feed):
def get_object(self, bits): def get_object(self, bits):
# [] , ['cbc'], ['cbc','lowmass'] # [] , ['cbc'], ['cbc','lowmass']
...@@ -40,7 +43,7 @@ class EventFeed(Feed): ...@@ -40,7 +43,7 @@ class EventFeed(Feed):
typecode, type = type[0] typecode, type = type[0]
title = "GraCEDb %s / %s Events" % (group.name, type) title = "GraCEDb %s / %s Events" % (group.name, type)
objs = objs.filter(analysisType=typecode) objs = objs.filter(analysisType=typecode)
return title, objs[:10] return title, objs[:FEED_MAX_RESULTS]
def title(self, obj): def title(self, obj):
title, _ = obj title, _ = obj
......
...@@ -49,6 +49,8 @@ LATENCY_REPORT_DEST_DIR = "/home/lars/django/data/latency" ...@@ -49,6 +49,8 @@ LATENCY_REPORT_DEST_DIR = "/home/lars/django/data/latency"
LATENCY_MAXIMUM_CHARTED = 1800 LATENCY_MAXIMUM_CHARTED = 1800
LATENCY_REPORT_WEB_PAGE_FILE_PATH = LATENCY_REPORT_DEST_DIR + "/latency.inc" LATENCY_REPORT_WEB_PAGE_FILE_PATH = LATENCY_REPORT_DEST_DIR + "/latency.inc"
# RSS Feed Defaults
FEED_MAX_RESULTS = 75
# Local time zone for this installation. Choices can be found here: # Local time zone for this installation. Choices can be found here:
# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name # http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
......
...@@ -40,6 +40,8 @@ LATENCY_REPORT_DEST_DIR = "/home/lars/django/data/latency" ...@@ -40,6 +40,8 @@ LATENCY_REPORT_DEST_DIR = "/home/lars/django/data/latency"
LATENCY_MAXIMUM_CHARTED = 1800 LATENCY_MAXIMUM_CHARTED = 1800
LATENCY_REPORT_WEB_PAGE_FILE_PATH = LATENCY_REPORT_DEST_DIR + "/latency.inc" LATENCY_REPORT_WEB_PAGE_FILE_PATH = LATENCY_REPORT_DEST_DIR + "/latency.inc"
# RSS Feed Defaults
FEED_MAX_RESULTS = 75
# Local time zone for this installation. Choices can be found here: # Local time zone for this installation. Choices can be found here:
# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name # http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment