Funktionierender Prototyp des Serious Games zur Vermittlung von Wissen zu Software-Engineering-Arbeitsmodellen.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

views.py 714B

1 year ago
12345678910111213141516171819202122
  1. from django.http import Http404
  2. from django.utils.translation import gettext as _
  3. def feed(request, url, feed_dict=None):
  4. """Provided for backwards compatibility."""
  5. if not feed_dict:
  6. raise Http404(_("No feeds are registered."))
  7. slug = url.partition("/")[0]
  8. try:
  9. f = feed_dict[slug]
  10. except KeyError:
  11. raise Http404(_("Slug %r isn’t registered.") % slug)
  12. instance = f()
  13. instance.feed_url = getattr(f, "feed_url", None) or request.path
  14. instance.title_template = f.title_template or ("feeds/%s_title.html" % slug)
  15. instance.description_template = f.description_template or (
  16. "feeds/%s_description.html" % slug
  17. )
  18. return instance(request)