Commit graph

19 commits

Author SHA1 Message Date
b7e2ce2a4d
Switch to relative imports
The relative imports make it clearer what code is within the project and where
it's coming from.
2023-10-20 09:45:53 +11:00
9e39d7eadc
Apply pyupgrade --py36-plus (but skip f-strings as we're on Python 3.5) 2023-09-07 23:15:48 +10:00
05bee8b3c3
Apply futurize --stage1 (safe) Python 2/3 compatibility changes. 2021-11-26 13:00:20 +11:00
Brett Smith
66dbfac066 Migrate RequestContext users to render() calls.
This was necessary because render_to_response no longer takes a
context_instance.  We were always using this to pass in a RequestContext,
which the render shortcut can already do, so switch to that.
2017-11-07 09:00:48 -05:00
Brett Smith
0160f03c25 blog: Remove unnecessary kwargs manipulation from custom_index.
I don't know if this code is left over from previous versions or what, but
it's not doing anything now.  custom_index doesn't pass kwargs to anything
else, so there's no need to fiddle with the dict so much.
2017-02-03 11:02:33 -05:00
Brett Smith
8115cb27e2 blog: Fix variable name typo in views code. 2017-02-03 10:31:51 -05:00
Bradley M. Kuhn
5c4cc1e2e1 Add sitefundgoal to top level view context.
The base template now has access to the fund-raising goal that will be
displayed site-wide.  The view here must provide it in the context for
access everywhere.

Furthermore, we need a local context processor to make sure it's in
context everywhere, and we have to make sure that context is properly
passed along.

This code is a bit cargo-culted in, based on what I read in various
places about adding the Request context.
2015-11-30 19:19:46 -08:00
Bradley M. Kuhn
f6bbcc7ee3 Just quit it with this relative import stuff.
While I think these relative imports seem to be valid for the running
application, I am having trouble with the django-admin applications
regarding them.  I don't see this syntactic sugar as absolutely
essential, so I'm just going to change it now.
2015-03-08 17:54:05 -07:00
Bradley M. Kuhn
1c6e685ee4 Remove dead code, no longer needed. 2015-03-04 15:31:05 -08:00
Bradley M. Kuhn
cdf9c67b42 Typo fix from last commit:
s/extra_content/extra_context/
2015-03-04 15:25:50 -08:00
Bradley M. Kuhn
1e396f77a3 More extra_context stuff? Put it all in there!
Simply move the blog_entries field into extra_context and pass the whole
darn thing along to the template.
2015-03-04 15:24:53 -08:00
Bradley M. Kuhn
8e6c2e54ac date_list should come from the extra_context too. 2015-03-04 15:18:18 -08:00
Bradley M. Kuhn
103ffefc87 Correct variables for setting. 2015-03-04 15:17:31 -08:00
Bradley M. Kuhn
1ed42c6c89 Must extract paginate_by from kwargs to use it. 2015-03-04 15:07:30 -08:00
Bradley M. Kuhn
b7316e0555 Paginator must be imported if one wants to use it. 2015-03-04 15:06:13 -08:00
Bradley M. Kuhn
8f4c8a69d6 Rework blog's custom_index for new pagination.
The pagination support changed, and as was previously done a few commits
ago for news, I'm trying a similar solution for blogs.

In this case, I'm trying to use the existing custom_index() method we
have and adapt it to properly support pagination in the way we want.

I'm not completely sure this will work, but I think it's at least close.
2015-03-04 15:04:13 -08:00
Tom Marble
2bf594b86c First pass at migration to Django 1.7 2015-03-03 18:40:18 +00:00
Bradley M. Kuhn
f7e45da6dd Adapted Django application stuff for Conservancy; and normalized to string
"conservancy" within code and templates.
2010-09-26 17:54:29 -04:00
Bradley M. Kuhn
8e6ea8ad71 Applications directory from SFLC website; About to adapt it for Conservancy website to run on its own 2010-09-26 17:32:53 -04:00