Use offset_linkid instead of offset to scan >1000 entities.
this is a first-cut. It works in all the ways I could make earlier
versions fail. It passes link_id as URL parameters. It also has a new
class LinkCreator which makes the main body of getListContents even easier
to write.
I wasn't sure if link_id's could have non alphanumeric characters; if so, they
need to be URL encoded/decoded.
I also need to go and remove any mention of raw offsets now, because we don't
use them.
I believe I've talked about this approach with a few of you and it sounded
reasonable. Feel free to roll-back/fix/amend/comment-for-me-to-fix. This is
my first big-logic-change to Melange.
Patch by: Dan Bentley
# Wrapper for loading templates from eggs via pkg_resources.resource_string.
try:
from pkg_resources import resource_string
except ImportError:
resource_string = None
from django.template import TemplateDoesNotExist
from django.conf import settings
def load_template_source(template_name, template_dirs=None):
"""
Loads templates from Python eggs via pkg_resource.resource_string.
For every installed app, it tries to get the resource (app, template_name).
"""
if resource_string is not None:
pkg_name = 'templates/' + template_name
for app in settings.INSTALLED_APPS:
try:
return (resource_string(app, pkg_name).decode(settings.FILE_CHARSET), 'egg:%s:%s' % (app, pkg_name))
except:
pass
raise TemplateDoesNotExist, template_name
load_template_source.is_usable = resource_string is not None