fix for django-extra-views 0.12.0 Updated class EventSeriesForm to use factory_kwargs.
This commit is contained in:
12
Makefile
Normal file
12
Makefile
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
PROJECT_PATH=$(CURDIR)
|
||||||
|
VENV_PATH=$(PROJECT_PATH)/venv
|
||||||
|
|
||||||
|
|
||||||
|
.PHONY: venv
|
||||||
|
venv: ## create venv for this Django Project
|
||||||
|
python3.5 -m venv --clear $(VENV_PATH)
|
||||||
|
( \
|
||||||
|
source $(VENV_PATH)/bin/activate; \
|
||||||
|
pip --upgrade pip; \
|
||||||
|
pip install -r $(PROJECT_PATH)/requirements/development.txt; \
|
||||||
|
)
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
SSH_LOGIN="kasu@s21.wservices.ch"
|
SSH_LOGIN="kasu@kasu.at"
|
||||||
SYNC_ASSESTS="requirements static"
|
SYNC_ASSESTS="requirements static"
|
||||||
SYNC_SOURCECODE="src"
|
SYNC_SOURCECODE="src"
|
||||||
EXCLUDE_FILES="*.pyc"
|
EXCLUDE_FILES="*.pyc"
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
export DJANGO_SETTINGS_MODULE=kasu.settings
|
export DJANGO_SETTINGS_MODULE=kasu.settings
|
||||||
source .virtualenv/bin/activate
|
source venv/bin/activate
|
||||||
./manage.py runserver 0.0.0.0:8000
|
./manage.py runserver 0.0.0.0:8000
|
||||||
|
|
||||||
|
|||||||
@@ -75,14 +75,17 @@ class EventForm(PermissionRequiredMixin, mixins.EventDetailMixin,
|
|||||||
class EventGallery(generic.ListView):
|
class EventGallery(generic.ListView):
|
||||||
"""Display a overview of all event photo albums."""
|
"""Display a overview of all event photo albums."""
|
||||||
template_name = 'events/photo_gallery.html'
|
template_name = 'events/photo_gallery.html'
|
||||||
queryset = models.Event.objects.filter(
|
|
||||||
start__lt=timezone.now(),
|
|
||||||
event_series__isnull=True,
|
|
||||||
photo_count__gt=0
|
|
||||||
)
|
|
||||||
queryset = queryset.order_by('-start')
|
|
||||||
paginate_by = 24
|
paginate_by = 24
|
||||||
|
|
||||||
|
def get_queryset(self):
|
||||||
|
queryset = models.Event.objects.filter(
|
||||||
|
start__lt=timezone.now(),
|
||||||
|
event_series__isnull=True,
|
||||||
|
photo_count__gt=0
|
||||||
|
)
|
||||||
|
queryset = queryset.order_by('-start')
|
||||||
|
return queryset
|
||||||
|
|
||||||
|
|
||||||
class EventListIcal(generic.View):
|
class EventListIcal(generic.View):
|
||||||
"""Generates an returns an iCal File with all upcoming events."""
|
"""Generates an returns an iCal File with all upcoming events."""
|
||||||
@@ -177,10 +180,9 @@ class EventSeriesForm(mixins.EventDetailMixin, PermissionRequiredMixin,
|
|||||||
InlineFormSetView):
|
InlineFormSetView):
|
||||||
model = models.Event
|
model = models.Event
|
||||||
inline_model = models.Event
|
inline_model = models.Event
|
||||||
fk_name = 'event_series'
|
|
||||||
fields = ('start', 'end')
|
fields = ('start', 'end')
|
||||||
form_class = forms.EventForm
|
form_class = forms.EventForm
|
||||||
extra = 3
|
factory_kwargs = {'extra': 3, 'fk_name': 'event_series'}
|
||||||
permission_required = 'events.add_event'
|
permission_required = 'events.add_event'
|
||||||
template_name = 'events/eventseries_form.html'
|
template_name = 'events/eventseries_form.html'
|
||||||
|
|
||||||
@@ -192,5 +194,7 @@ class EventSeriesForm(mixins.EventDetailMixin, PermissionRequiredMixin,
|
|||||||
|
|
||||||
|
|
||||||
class UpcomingEvents(generic.ListView):
|
class UpcomingEvents(generic.ListView):
|
||||||
queryset = models.Event.objects.upcoming(limit=None)
|
|
||||||
paginate_by = 16
|
paginate_by = 16
|
||||||
|
|
||||||
|
def get_queryset(self):
|
||||||
|
return models.Event.objects.upcoming(limit=None)
|
||||||
|
|||||||
Reference in New Issue
Block a user