Commit graph

34 commits

Author SHA1 Message Date
9e39d7eadc
Apply pyupgrade --py36-plus (but skip f-strings as we're on Python 3.5) 2023-09-07 23:15:48 +10:00
60010999d2
Remove use of python3-future 2023-09-07 22:59:23 +10:00
4ceb4b4ae2
Fix whitespace 2023-02-11 17:22:32 +11:00
adf2229720
Rename __unicode__ methods to __str__ following Django upgrade. 2022-01-11 09:13:46 +11:00
b2e952f3b8
Fix URLconfs causing Django check warnings. 2021-12-17 18:14:50 +11:00
e9df3a0d7e
Remove unnecessary null=True on ManyToManyFields. 2021-12-17 17:25:38 +11:00
2d078b0004
Apply futurize --stage-2 Python 2/3 compatibility transformations.
These changes specifically require the use of the "future" library.
2021-11-30 07:55:45 +11:00
7b981fcb52
Add a missed "object" change. 2021-11-26 14:03:24 +11:00
31e51a7742
Apply "object" changes only from futurize --stage2. 2021-11-26 13:49:40 +11:00
Bradley M. Kuhn
c564f15511 Correct & update hard-coded domain names from legacy codebase. 2020-01-24 09:26:59 -08:00
Brett Smith
3b2ed8397d blog/news: Add Open Graph metadata to entry pages.
This helps other social media sites generate nice previews for these pages.
2017-11-07 11:17:33 -05:00
Brett Smith
87961c6cee templatetags: Add fill_url.
This gives templates an easy way to generate full URLs using host_url.
2017-11-07 10:13:48 -05: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
b2a006f49c urls: Migrate from patterns strings to plain lists of urls. 2017-11-07 09:00:48 -05:00
Brett Smith
ce1b4b2528 Remove noop conservancy.context_processors imports.
You'll note this source doesn't exist in Git.
There's a reason for that.
2016-12-02 22:21:40 -05:00
Bradley M. Kuhn
d305f5103f Implement min filter. 2015-11-30 20:33:14 -08:00
Bradley M. Kuhn
99d3325e33 Create subtract filter. 2015-11-30 19:19:46 -08: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
71834b60ec Fix another typo in import correction. 2015-03-08 18:16:33 -07:00
Bradley M. Kuhn
a5cd6ab63b Make defaults for BooleanFields.
According to django-admin check,

   (1_6.W002) BooleanField does not have a default value.
    HINT: Django 1.6 changed the default value of BooleanField from False to None. See https://docs.djangoproject.com/en/1.6/ref/models/fields/#booleanfield for more information.
2015-03-08 18:00:50 -07: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
47b446cd3b Correct template path name. 2015-03-04 12:42:42 -08:00
Bradley M. Kuhn
c478c2165b import render_to_response 2015-03-04 12:35:30 -08:00
Bradley M. Kuhn
87c68de62a news_queryset is what we wanted here, not news. 2015-03-04 12:33:12 -08:00
Bradley M. Kuhn
076345298e Allow additional arguments to listing() call.
The urls setup of old gave us various arguments at call time for
custom_index(), and some where useful.  Hopefully, listing() can support
the same type of system, over time, once adapted.  Here's an attempt to
get it started, first by supporting paginate_by.
2015-03-04 12:30:54 -08:00
Bradley M. Kuhn
317dd24206 Remove custom_index() method from news view.
I don't believe custom_index() should be used anymore given that we have
this new listing setup.  At least, that's what I surmise based on
current error messages.  I may bring this back if removing it breaks
something else.
2015-03-04 12:28:03 -08:00
Bradley M. Kuhn
00995bff4d Fix cut and paste error from documentation
This is trying to build a pagination of a news queryset.

HT tmarble for pointing this out.
2015-03-04 12:22:33 -08:00
Bradley M. Kuhn
5c7710954b Attempt to use Django 1.7 Paginator object.
Upon reading
  https://docs.djangoproject.com/en/1.7/topics/pagination/#using-paginator-in-a-view

I wonder if we should simply follow this model for pagination of news
items.  I've attempted to adapt that herein.  This is a first attempt
and likely will have issues.
2015-03-04 12:08:39 -08:00
Tom Marble
f742f86f4b fixed /admin 2015-03-04 19:30:51 +00:00
Tom Marble
86e1646f8f Fixed "(page of)" thing at the top of news 2015-03-03 19:23:57 +00:00
Tom Marble
2bf594b86c First pass at migration to Django 1.7 2015-03-03 18:40:18 +00:00
Bradley M. Kuhn
85eae7afbb removed reference to SFLC object 2010-09-30 10:24:03 -04: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