Changeset - 47a30a750ad1
[Not reviewed]
0 45 0
Ben Sturmfels (bsturmfels) - 6 months ago 2023-10-19 22:52:39
ben@sturm.com.au
Sort Python imports with isort
45 files changed with 103 insertions and 51 deletions:
0 comments (0 inline, 0 general)
www/conservancy/apps/assignment/migrations/0002_auto_20211206_2237.py
Show inline comments
 
# Generated by Django 1.11.29 on 2021-12-06 22:37
 

	
 
import datetime
 

	
 
from django.db import migrations, models
 
import django_countries.fields
 

	
www/conservancy/apps/assignment/migrations/0003_auto_20211206_2249.py
Show inline comments
 
# Generated by Django 1.11.29 on 2021-12-06 22:49
 

	
 
from django.db import migrations, models
 
import uuid
 

	
 
from django.db import migrations, models
 

	
 

	
 
class Migration(migrations.Migration):
 

	
www/conservancy/apps/assignment/migrations/0004_auto_20230127_0602.py
Show inline comments
 
# Generated by Django 1.11.29 on 2023-01-27 06:02
 

	
 
from django.db import migrations, models
 

	
 
from ..models import validate_mutiple_urls
 

	
 

	
 
class Migration(migrations.Migration):
 

	
 
    dependencies = [
www/conservancy/apps/assignment/urls.py
Show inline comments
...
 
@@ -2,7 +2,6 @@ from django.conf.urls import url
 

	
 
from .views import AssignmentCreateView, AssignmentThanksView
 

	
 

	
 
urlpatterns = [
 
    url(r'^$', AssignmentCreateView.as_view(), name='assignement-add'),
 
    url(r'^(?P<pk>[\w-]+)/$', AssignmentThanksView.as_view(), name='assignment-thanks'),
www/conservancy/apps/assignment/views.py
Show inline comments
...
 
@@ -6,6 +6,7 @@ from django.views.generic.edit import CreateView
 
from .forms import AssignmentForm
 
from .models import Assignment
 

	
 

	
 
class AssignmentCreateView(CreateView):
 
    """Show a form for the initial  copyright assignment."""
 

	
www/conservancy/apps/blog/admin.py
Show inline comments
 
from django.contrib import admin
 

	
 
from .models import EntryTag, Entry
 
from .models import Entry, EntryTag
 

	
 

	
 
class EntryTagAdmin(admin.ModelAdmin):
www/conservancy/apps/blog/models.py
Show inline comments
 
from datetime import datetime, timedelta
 

	
 
from django.db import models
 
from django.conf import settings
 
from django.db import models
 

	
 
from ... import bsoup
 
from ..staff.models import Person
www/conservancy/apps/blog/urls.py
Show inline comments
 
from datetime import datetime
 

	
 
from django.conf.urls import url, include
 
from django.conf.urls import include, url
 

	
 
from .models import Entry, EntryTag
 
from ..staff.models import Person
 
from .views import last_name, BlogYearArchiveView, BlogMonthArchiveView, BlogDayArchiveView, BlogDateDetailView, custom_index, query
 
from .models import Entry, EntryTag
 
from .views import (
 
    BlogDateDetailView,
 
    BlogDayArchiveView,
 
    BlogMonthArchiveView,
 
    BlogYearArchiveView,
 
    custom_index,
 
    last_name,
 
    query,
 
)
 

	
 
extra_context = {}
 

	
www/conservancy/apps/blog/views.py
Show inline comments
 
from datetime import datetime
 
from functools import reduce
 

	
 
from django.views.generic import ListView
 
from django.views.generic.dates import YearArchiveView, MonthArchiveView, DayArchiveView, DateDetailView
 
from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger
 
from django.core.paginator import EmptyPage, PageNotAnInteger, Paginator
 
from django.shortcuts import get_object_or_404, render
 
from django.views.generic import ListView
 
from django.views.generic.dates import (
 
    DateDetailView,
 
    DayArchiveView,
 
    MonthArchiveView,
 
    YearArchiveView,
 
)
 

	
 
from .models import Entry, EntryTag
 
from ..staff.models import Person
 
from .models import Entry, EntryTag
 

	
 

	
 
def OR_filter(field_name, objs):
www/conservancy/apps/contacts/models.py
Show inline comments
 
from django.db import models
 

	
 

	
 
class ContactEntry(models.Model):
 
    """Conservancy contact system
 

	
www/conservancy/apps/contacts/urls.py
Show inline comments
 
from django.conf.urls import patterns, url, include
 
from django.conf.urls import include, patterns, url
 

	
 
urlpatterns = patterns('conservancy.apps.contacts.views',
 
   (r'^/?$', 'subscribe'),
www/conservancy/apps/contacts/views.py
Show inline comments
 
from django.shortcuts import render
 
from django import forms
 
from django.forms import ModelForm
 
from django.shortcuts import render
 

	
 
from .models import ContactEntry
 

	
www/conservancy/apps/contractpatch/urls.py
Show inline comments
 
from django.conf.urls import url, include
 
from django.conf.urls import include, url
 

	
 
from . import views as cpatch_views
 

	
www/conservancy/apps/events/admin.py
Show inline comments
 
from django.contrib import admin
 

	
 
from .models import EventTag, Event, EventMedia
 
from .models import Event, EventMedia, EventTag
 

	
 
admin.site.register(EventTag)
 

	
www/conservancy/apps/events/urls.py
Show inline comments
 
from django.conf.urls import patterns, url, include
 
from django.conf.urls import include, patterns, url
 

	
 
from .models import Event
 

	
www/conservancy/apps/events/views.py
Show inline comments
 
# from django.views.generic.list_detail import object_list
 
from django.shortcuts import render
 
from django.core.exceptions import ObjectDoesNotExist
 
from django.http import Http404, HttpResponse
 
from django.shortcuts import render
 
from django.template import loader
 
from django.core.exceptions import ObjectDoesNotExist
 

	
 
from .models import Event
 

	
www/conservancy/apps/fossy/migrations/0001_initial.py
Show inline comments
 
# Generated by Django 1.11.29 on 2023-01-27 06:19
 

	
 
from django.db import migrations, models
 
import uuid
 

	
 
from django.db import migrations, models
 

	
 

	
 
class Migration(migrations.Migration):
 

	
www/conservancy/apps/fossy/urls.py
Show inline comments
...
 
@@ -2,7 +2,6 @@ from django.conf.urls import url
 

	
 
from .views import CommunityTrackProposalCreateView, CommunityTrackProposalThanksView
 

	
 

	
 
urlpatterns = [
 
    url(r'^community-tracks/$', CommunityTrackProposalCreateView.as_view(), name='fossy-add'),
 
    url(r'^(?P<pk>[\w-]+)/$', CommunityTrackProposalThanksView.as_view(), name='fossy-thanks'),
www/conservancy/apps/news/admin.py
Show inline comments
 
from django.contrib import admin
 

	
 
from .models import PressRelease, ExternalArticleTag, ExternalArticle
 
from .models import ExternalArticle, ExternalArticleTag, PressRelease
 

	
 

	
 
class PressReleaseAdmin(admin.ModelAdmin):
www/conservancy/apps/news/models.py
Show inline comments
 
from datetime import datetime, timedelta
 

	
 
from django.db import models
 
from django.conf import settings
 
from django.contrib.sites.models import Site
 
from django.db import models
 

	
 
from ... import bsoup
 
from ..staff.models import Person
 
from ..events.models import Event
 
from ..staff.models import Person
 

	
 

	
 
class PressRelease(models.Model, bsoup.SoupModelMixin):
www/conservancy/apps/news/templatetags/date_within.py
Show inline comments
 
from datetime import datetime, timedelta
 

	
 
from django import template
 
from datetime import timedelta, datetime
 

	
 
register = template.Library()
 

	
www/conservancy/apps/news/templatetags/min.py
Show inline comments
 
from django import template
 

	
 
register = template.Library()
 

	
 
@register.filter
www/conservancy/apps/news/templatetags/subtract.py
Show inline comments
 
from django import template
 

	
 
register = template.Library()
 

	
 
@register.filter
www/conservancy/apps/news/urls.py
Show inline comments
...
 
@@ -17,11 +17,17 @@
 
# along with this program in a file in the toplevel directory called
 
# "AGPLv3".  If not, see <http://www.gnu.org/licenses/>.
 

	
 
from django.conf.urls import url, include
 
from django.conf import settings
 
from django.conf.urls import include, url
 

	
 
from .models import PressRelease, ExternalArticle
 
from .views import NewsYearArchiveView, NewsMonthArchiveView, NewsDayArchiveView, NewsDateDetailView, listing
 
from .models import ExternalArticle, PressRelease
 
from .views import (
 
    NewsDateDetailView,
 
    NewsDayArchiveView,
 
    NewsMonthArchiveView,
 
    NewsYearArchiveView,
 
    listing,
 
)
 

	
 
info_dict = {
 
    'queryset': PressRelease.objects.all().filter(sites__id__exact=settings.SITE_ID),
www/conservancy/apps/news/views.py
Show inline comments
 
from datetime import datetime
 

	
 
from django.views.generic import ListView
 
from django.shortcuts import render
 
from django.views.generic.dates import YearArchiveView, MonthArchiveView, DayArchiveView, DateDetailView
 
from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger
 
from django.core.paginator import EmptyPage, PageNotAnInteger, Paginator
 
from django.http import HttpResponse
 
from django.shortcuts import render
 
from django.views.generic import ListView
 
from django.views.generic.dates import (
 
    DateDetailView,
 
    DayArchiveView,
 
    MonthArchiveView,
 
    YearArchiveView,
 
)
 

	
 
from .models import ExternalArticle
 
from .models import PressRelease
 
from ..events.models import Event
 
from .models import ExternalArticle, PressRelease
 

	
 

	
 
class NewsListView(ListView):
www/conservancy/apps/staff/models.py
Show inline comments
 
from django.db import models
 

	
 

	
 
class Person(models.Model):
 
    """Staff members
 

	
www/conservancy/apps/summit_registration/models.py
Show inline comments
 
from django.db import models
 

	
 

	
 
class SummitRegistration(models.Model):
 
    """Form fields for summit registrants"""
 

	
www/conservancy/apps/summit_registration/urls.py
Show inline comments
 
from django.conf.urls import patterns, url, include
 
from django.conf.urls import include, patterns, url
 

	
 
urlpatterns = patterns('conservancy.apps.summit_registration.views',
 
   (r'^/?$', 'register'),
www/conservancy/apps/summit_registration/views.py
Show inline comments
 
from django.shortcuts import render
 
from django import forms
 
from conervancy.apps.summit_registration.models import SummitRegistration
 
from django import forms
 
from django.shortcuts import render
 

	
 

	
 
def register(request):
 
    """Summit registration form view
www/conservancy/apps/supporters/models.py
Show inline comments
 
from django.db import models
 

	
 

	
 
class Supporter(models.Model):
 
    """Conservancy Supporter listing"""
 

	
www/conservancy/apps/worldmap/models.py
Show inline comments
 
from django.db import models
 

	
 

	
 
class EarthLocation(models.Model):
 
    """Represents latitude and longitude, with a label"""
 

	
www/conservancy/bsoup.py
Show inline comments
...
 
@@ -5,6 +5,7 @@ import re
 
import bs4
 
import bs4.element
 

	
 

	
 
class BeautifulSoup(bs4.BeautifulSoup):
 
    """A wrapper of the original BeautifulSoup class, with convenience methods added."""
 

	
www/conservancy/static/projects/policies/publish-policy.py
Show inline comments
...
 
@@ -13,9 +13,9 @@ import tempfile
 

	
 
try:
 
    import markdown
 
    from markdown.extensions import tables as mdx_tables
 
    from markdown.extensions import sane_lists as mdx_sane_lists
 
    from markdown.extensions import smarty as mdx_smarty
 
    from markdown.extensions import tables as mdx_tables
 
    from markdown.extensions import toc as mdx_toc
 
    markdown_import_success = True
 
except ImportError:
www/conservancy/static/views.py
Show inline comments
 
import mimetypes
 
import os.path
 

	
 
from django.http import HttpResponse
 
from django.template.response import TemplateResponse
 

	
www/conservancy/urls.py
Show inline comments
...
 
@@ -17,7 +17,7 @@
 
# along with this program in a file in the toplevel directory called
 
# "AGPLv3".  If not, see <http://www.gnu.org/licenses/>.
 

	
 
from django.conf.urls import url, include
 
from django.conf.urls import include, url
 
from django.contrib import admin
 

	
 
from . import feeds, frontpage, sponsors
www/conservancy_ssl_wrapper.py
Show inline comments
...
 
@@ -21,6 +21,7 @@
 
# so we just bypass it altogether and set the relevant variable here.
 
# See deployment documentation for more info.
 
from os import environ
 

	
 
environ["DJANGO_SETTINGS_MODULE"] = 'conservancy_ssl.settings'
 
environ["CANONICAL_HOSTNAME"] = 'sfconservancy.org'
 

	
www/conservancy_wrapper.py
Show inline comments
...
 
@@ -2,6 +2,7 @@
 
# so we just bypass it altogether and set the relevant variable here.
 
# See deployment documentation for more info.
 
from os import environ
 

	
 
environ["DJANGO_SETTINGS_MODULE"] = 'conservancy.settings'
 
environ["CANONICAL_HOSTNAME"] = 'sfconservancy.org'
 

	
www/modpythoncustom.py
Show inline comments
 
from mod_python import apache
 

	
 

	
 
# 404 should do NOTHING so apache can handle it.  This view is referenced
 
# in sflc.urls
 
def view404(request):
...
 
@@ -30,6 +31,8 @@ def outputfilter(filter):
 
    if s is None:
 
        filter.close()
 

	
 
from django.core.handlers.modpython import *
 

	
 
# This is unreferenced from this file, but it must be imported to
 
# enable template inheritance in the outputfilter!
 
import django.template.loader
...
 
@@ -37,7 +40,6 @@ import django.template.loader
 
# And now we override a few things in the module
 
# django.core.handlers.modpython
 

	
 
from django.core.handlers.modpython import *
 
del handler
 

	
 
class ModPythonRequest(ModPythonRequest):
www/podjango/admin.py
Show inline comments
...
 
@@ -18,7 +18,8 @@
 
#
 
from django.contrib import admin
 

	
 
from .models import CastTag, Cast
 
from .models import Cast, CastTag
 

	
 

	
 
class CastTagAdmin(admin.ModelAdmin):
 
    prepopulated_fields = {'slug': ('label',)}
www/podjango/feeds.py
Show inline comments
...
 
@@ -21,11 +21,11 @@ from datetime import datetime
 
import itertools
 
import operator
 

	
 
from django.conf import settings
 
from django.contrib.sites.shortcuts import get_current_site
 
from django.contrib.syndication.views import add_domain, Feed
 
from django.utils.feedgenerator import Rss201rev2Feed 
 
from django.contrib.syndication.views import Feed, add_domain
 
from django.shortcuts import render
 
from django.conf import settings
 
from django.utils.feedgenerator import Rss201rev2Feed
 

	
 
from .models import Cast
 

	
www/podjango/frontpage.py
Show inline comments
...
 
@@ -17,11 +17,13 @@
 
# along with this program in a file in the toplevel directory called
 
# "AGPLv3".  If not, see <http://www.gnu.org/licenses/>.
 

	
 
from django.shortcuts import render
 
from datetime import datetime, timedelta
 

	
 
from django.shortcuts import render
 

	
 
from .models import Cast
 

	
 

	
 
def view(request):
 
    """Cast front page view
 
    Performs all object queries necessary to render the front page.
www/podjango/models.py
Show inline comments
...
 
@@ -16,10 +16,11 @@
 
# along with this program in a file in the toplevel directory called
 
# "AGPLv3".  If not, see <http://www.gnu.org/licenses/>.
 
#
 
from django.db import models
 
from datetime import datetime, timedelta
 

	
 
from django.conf import settings
 
from django.db import models
 
from django.urls import reverse
 
from datetime import datetime, timedelta
 

	
 

	
 
class CastTag(models.Model):
www/podjango/templatetags/date_within.py
Show inline comments
 
from datetime import datetime, timedelta
 

	
 
from django import template
 
from datetime import timedelta, datetime
 

	
 
register = template.Library()
 

	
www/podjango/urls.py
Show inline comments
...
 
@@ -18,13 +18,18 @@
 
# "AGPLv3".  If not, see <http://www.gnu.org/licenses/>.
 

	
 
from django.conf import settings
 
from django.conf.urls import url, include
 
from django.conf.urls import include, url
 
from django.contrib import admin
 
from django.contrib.syndication.views import Feed
 
from django.views.generic.dates import DateDetailView, DayArchiveView, MonthArchiveView, YearArchiveView
 
from django.views.generic.dates import (
 
    DateDetailView,
 
    DayArchiveView,
 
    MonthArchiveView,
 
    YearArchiveView,
 
)
 

	
 
from . import frontpage
 
from .feeds import feed_dict, view, Mp3CastFeed, OggCastFeed
 
from .feeds import Mp3CastFeed, OggCastFeed, feed_dict, view
 
from .models import Cast, CastTag
 
from .views import custom_index, query
 

	
www/podjango/views.py
Show inline comments
...
 
@@ -19,8 +19,8 @@
 
from datetime import datetime
 
from functools import reduce
 

	
 
from django.views.generic.list import ListView
 
from django.shortcuts import get_object_or_404, render
 
from django.views.generic.list import ListView
 

	
 
from .models import Cast, CastTag
 

	
0 comments (0 inline, 0 general)