diff --git a/changelog b/changelog index 39f0ee368..8f5b14f00 100644 --- a/changelog +++ b/changelog @@ -1,4 +1,4 @@ -ietfdb (6.34.0) ietf; urgency=high +ietfdb (6.34.0) ietf; urgency=medium **New proceedings pages** diff --git a/ietf/api/__init__.py b/ietf/api/__init__.py index 8d70c91a0..c544be054 100644 --- a/ietf/api/__init__.py +++ b/ietf/api/__init__.py @@ -1,6 +1,7 @@ import re import six import datetime +from urllib import urlencode from django.conf import settings from django.http import HttpResponse @@ -21,6 +22,19 @@ import debug # pyflakes:ignore _api_list = [] +class ModelResource(tastypie.resources.ModelResource): + def generate_cache_key(self, *args, **kwargs): + """ + Creates a unique-enough cache key. + + This is based off the current api_name/resource_name/args/kwargs. + """ + #smooshed = ["%s=%s" % (key, value) for key, value in kwargs.items()] + smooshed = urlencode(kwargs) + + # Use a list plus a ``.join()`` because it's faster than concatenation. + return "%s:%s:%s:%s" % (self._meta.api_name, self._meta.resource_name, ':'.join(args), ':'.join(sorted(smooshed))) + class Serializer(BaseSerializer): def to_html(self, data, options=None): """ diff --git a/ietf/community/resources.py b/ietf/community/resources.py index 0e114628c..fa6330be3 100644 --- a/ietf/community/resources.py +++ b/ietf/community/resources.py @@ -1,5 +1,5 @@ # Autogenerated by the mkresources management command 2014-11-13 23:53 -from tastypie.resources import ModelResource +from ietf.api import ModelResource from tastypie.fields import ToOneField, ToManyField from tastypie.constants import ALL, ALL_WITH_RELATIONS from tastypie.cache import SimpleCache diff --git a/ietf/dbtemplate/resources.py b/ietf/dbtemplate/resources.py index 14c76c6af..f043428c9 100644 --- a/ietf/dbtemplate/resources.py +++ b/ietf/dbtemplate/resources.py @@ -1,5 +1,5 @@ # Autogenerated by the mkresources management command 2014-11-13 23:53 -from tastypie.resources import ModelResource +from ietf.api import ModelResource from tastypie.fields import ToOneField from tastypie.constants import ALL, ALL_WITH_RELATIONS from tastypie.cache import SimpleCache diff --git a/ietf/doc/resources.py b/ietf/doc/resources.py index f8bcf310c..3df4ebd8d 100644 --- a/ietf/doc/resources.py +++ b/ietf/doc/resources.py @@ -1,5 +1,5 @@ # Autogenerated by the makeresources management command 2015-10-19 12:29 PDT -from tastypie.resources import ModelResource +from ietf.api import ModelResource from ietf.api import ToOneField from tastypie.fields import ToManyField, CharField from tastypie.constants import ALL, ALL_WITH_RELATIONS # pyflakes:ignore diff --git a/ietf/group/resources.py b/ietf/group/resources.py index 46ec1d810..70b4e062e 100644 --- a/ietf/group/resources.py +++ b/ietf/group/resources.py @@ -1,5 +1,5 @@ # Autogenerated by the mkresources management command 2014-11-13 23:15 -from tastypie.resources import ModelResource +from ietf.api import ModelResource from ietf.api import ToOneField from tastypie.fields import ToManyField from tastypie.constants import ALL, ALL_WITH_RELATIONS diff --git a/ietf/iesg/resources.py b/ietf/iesg/resources.py index 56eb520d2..2fdc105a1 100644 --- a/ietf/iesg/resources.py +++ b/ietf/iesg/resources.py @@ -1,5 +1,5 @@ # Autogenerated by the mkresources management command 2014-11-13 23:53 -from tastypie.resources import ModelResource +from ietf.api import ModelResource from tastypie.constants import ALL from tastypie.cache import SimpleCache diff --git a/ietf/ipr/resources.py b/ietf/ipr/resources.py index 58157c3d7..ed9f6aba1 100644 --- a/ietf/ipr/resources.py +++ b/ietf/ipr/resources.py @@ -1,5 +1,5 @@ # Autogenerated by the mkresources management command 2015-03-21 14:05 PDT -from tastypie.resources import ModelResource +from ietf.api import ModelResource from ietf.api import ToOneField from tastypie.fields import ToManyField # pyflakes:ignore from tastypie.constants import ALL, ALL_WITH_RELATIONS # pyflakes:ignore diff --git a/ietf/liaisons/resources.py b/ietf/liaisons/resources.py index 5d9761154..c93dc12e3 100644 --- a/ietf/liaisons/resources.py +++ b/ietf/liaisons/resources.py @@ -1,5 +1,5 @@ # Autogenerated by the makeresources management command 2015-10-11 13:15 PDT -from tastypie.resources import ModelResource +from ietf.api import ModelResource from ietf.api import ToOneField from tastypie.fields import ToManyField # pyflakes:ignore from tastypie.constants import ALL, ALL_WITH_RELATIONS # pyflakes:ignore diff --git a/ietf/mailinglists/resources.py b/ietf/mailinglists/resources.py index 49f1786b5..e4abee20d 100644 --- a/ietf/mailinglists/resources.py +++ b/ietf/mailinglists/resources.py @@ -1,6 +1,6 @@ # Copyright The IETF Trust 2016, All Rights Reserved # Autogenerated by the makeresources management command 2016-06-12 12:29 PDT -from tastypie.resources import ModelResource +from ietf.api import ModelResource from tastypie.fields import ToManyField # pyflakes:ignore from tastypie.constants import ALL, ALL_WITH_RELATIONS # pyflakes:ignore from tastypie.cache import SimpleCache diff --git a/ietf/mailtrigger/resources.py b/ietf/mailtrigger/resources.py index 6ba4cd99b..eb5466618 100644 --- a/ietf/mailtrigger/resources.py +++ b/ietf/mailtrigger/resources.py @@ -1,5 +1,5 @@ # Autogenerated by the makeresources management command 2015-08-06 11:00 PDT -from tastypie.resources import ModelResource +from ietf.api import ModelResource from ietf.api import ToOneField # pyflakes:ignore from tastypie.fields import ToManyField # pyflakes:ignore from tastypie.constants import ALL, ALL_WITH_RELATIONS # pyflakes:ignore diff --git a/ietf/meeting/resources.py b/ietf/meeting/resources.py index 276178418..0155c950e 100644 --- a/ietf/meeting/resources.py +++ b/ietf/meeting/resources.py @@ -1,5 +1,5 @@ # Autogenerated by the mkresources management command 2014-11-13 23:15 -from tastypie.resources import ModelResource +from ietf.api import ModelResource from ietf.api import ToOneField from tastypie.fields import ToManyField, DateTimeField from tastypie.constants import ALL, ALL_WITH_RELATIONS diff --git a/ietf/message/resources.py b/ietf/message/resources.py index 68f021a08..a128597a1 100644 --- a/ietf/message/resources.py +++ b/ietf/message/resources.py @@ -1,5 +1,5 @@ # Autogenerated by the mkresources management command 2014-11-13 23:53 -from tastypie.resources import ModelResource +from ietf.api import ModelResource from ietf.api import ToOneField from tastypie.fields import ToManyField from tastypie.constants import ALL, ALL_WITH_RELATIONS diff --git a/ietf/name/resources.py b/ietf/name/resources.py index 57e03841a..801fd9f29 100644 --- a/ietf/name/resources.py +++ b/ietf/name/resources.py @@ -1,5 +1,5 @@ # Autogenerated by the makeresources management command 2015-08-27 11:01 PDT -from tastypie.resources import ModelResource +from ietf.api import ModelResource from ietf.api import ToOneField # pyflakes:ignore from tastypie.fields import ToManyField # pyflakes:ignore from tastypie.constants import ALL, ALL_WITH_RELATIONS # pyflakes:ignore diff --git a/ietf/nomcom/resources.py b/ietf/nomcom/resources.py index 0bbcb784d..ec8c98a52 100644 --- a/ietf/nomcom/resources.py +++ b/ietf/nomcom/resources.py @@ -1,5 +1,5 @@ # Autogenerated by the mkresources management command 2014-11-13 23:53 -from tastypie.resources import ModelResource +from ietf.api import ModelResource from ietf.api import ToOneField from tastypie.fields import ToManyField from tastypie.constants import ALL, ALL_WITH_RELATIONS diff --git a/ietf/person/resources.py b/ietf/person/resources.py index f38e7ef88..045b5ece4 100644 --- a/ietf/person/resources.py +++ b/ietf/person/resources.py @@ -1,5 +1,5 @@ # Autogenerated by the mkresources management command 2014-11-13 23:53 -from tastypie.resources import ModelResource +from ietf.api import ModelResource from tastypie.fields import ToOneField from tastypie.constants import ALL, ALL_WITH_RELATIONS from tastypie.cache import SimpleCache diff --git a/ietf/redirects/resources.py b/ietf/redirects/resources.py index bf35c6d4c..a9e9632c9 100644 --- a/ietf/redirects/resources.py +++ b/ietf/redirects/resources.py @@ -1,5 +1,5 @@ # Autogenerated by the mkresources management command 2014-11-13 23:53 -from tastypie.resources import ModelResource +from ietf.api import ModelResource from tastypie.fields import ToOneField from tastypie.constants import ALL, ALL_WITH_RELATIONS from tastypie.cache import SimpleCache diff --git a/ietf/settings.py b/ietf/settings.py index 54a7ec1f6..a4caac3f2 100644 --- a/ietf/settings.py +++ b/ietf/settings.py @@ -716,11 +716,11 @@ if SERVER_MODE != 'production': # stomp out the cached template loader, it's annoying TEMPLATE_LOADERS = tuple(l for e in TEMPLATE_LOADERS for l in (e[1] if isinstance(e, tuple) and "cached.Loader" in e[0] else (e,))) - CACHES = { - 'default': { - 'BACKEND': 'django.core.cache.backends.dummy.DummyCache', - } - } +# CACHES = { +# 'default': { +# 'BACKEND': 'django.core.cache.backends.dummy.DummyCache', +# } +# } SESSION_ENGINE = "django.contrib.sessions.backends.db" if 'SECRET_KEY' not in locals(): diff --git a/ietf/submit/resources.py b/ietf/submit/resources.py index 192b71bdc..644b3f5bd 100644 --- a/ietf/submit/resources.py +++ b/ietf/submit/resources.py @@ -1,5 +1,5 @@ # Autogenerated by the mkresources management command 2014-11-13 23:53 -from tastypie.resources import ModelResource +from ietf.api import ModelResource from tastypie.fields import ToOneField from tastypie.constants import ALL, ALL_WITH_RELATIONS from tastypie.cache import SimpleCache diff --git a/ietf/utils/resources.py b/ietf/utils/resources.py index f819e2bf9..4f27081a8 100644 --- a/ietf/utils/resources.py +++ b/ietf/utils/resources.py @@ -1,5 +1,5 @@ # Autogenerated by the mkresources management command 2014-11-13 05:39 -from tastypie.resources import ModelResource +from ietf.api import ModelResource from tastypie.fields import CharField from tastypie.constants import ALL from tastypie.cache import SimpleCache