move createcamp script to camps app
This commit is contained in:
parent
6cf4e9577b
commit
733028e4b7
0
src/camps/management/__init__.py
Normal file
0
src/camps/management/__init__.py
Normal file
0
src/camps/management/commands/__init__.py
Normal file
0
src/camps/management/commands/__init__.py
Normal file
|
@ -28,9 +28,9 @@ class Command(BaseCommand):
|
||||||
|
|
||||||
# files to create, relative to DJANGO_BASE_PATH
|
# files to create, relative to DJANGO_BASE_PATH
|
||||||
files = [
|
files = [
|
||||||
'sponsors/templates/{camp_slug}-sponsors.html',
|
'sponsors/templates/{camp_slug}_sponsors.html',
|
||||||
'camps/templates/{camp_slug}-camp_detail.html',
|
'camps/templates/{camp_slug}_camp_detail.html',
|
||||||
'program/templates/{camp_slug}-call_for_speakers.html'
|
'program/templates/{camp_slug}_call_for_speakers.html'
|
||||||
]
|
]
|
||||||
|
|
||||||
# directories to create, relative to DJANGO_BASE_PATH
|
# directories to create, relative to DJANGO_BASE_PATH
|
|
@ -1,6 +1,6 @@
|
||||||
from django.views.generic import ListView, DetailView
|
from django.views.generic import ListView, DetailView
|
||||||
from django.utils import timezone
|
from django.utils import timezone
|
||||||
from .models import *
|
from .models import Camp
|
||||||
from django.shortcuts import redirect
|
from django.shortcuts import redirect
|
||||||
from .mixins import CampViewMixin
|
from .mixins import CampViewMixin
|
||||||
from django.views import View
|
from django.views import View
|
||||||
|
@ -10,7 +10,7 @@ logger = logging.getLogger("bornhack.%s" % __name__)
|
||||||
|
|
||||||
|
|
||||||
class CampRedirectView(CampViewMixin, View):
|
class CampRedirectView(CampViewMixin, View):
|
||||||
logger = logging.getLogger("bornhack.%s" % __name__)
|
|
||||||
def dispatch(self, request, *args, **kwargs):
|
def dispatch(self, request, *args, **kwargs):
|
||||||
# find the closest camp in the past
|
# find the closest camp in the past
|
||||||
prevcamp = Camp.objects.filter(camp__endswith__lt=timezone.now()).order_by('-camp')[0]
|
prevcamp = Camp.objects.filter(camp__endswith__lt=timezone.now()).order_by('-camp')[0]
|
||||||
|
|
Loading…
Reference in a new issue