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
|
||||
|
||||
SSH_LOGIN="kasu@s21.wservices.ch"
|
||||
SSH_LOGIN="kasu@kasu.at"
|
||||
SYNC_ASSESTS="requirements static"
|
||||
SYNC_SOURCECODE="src"
|
||||
EXCLUDE_FILES="*.pyc"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#!/bin/sh
|
||||
|
||||
export DJANGO_SETTINGS_MODULE=kasu.settings
|
||||
source .virtualenv/bin/activate
|
||||
source venv/bin/activate
|
||||
./manage.py runserver 0.0.0.0:8000
|
||||
|
||||
|
||||
@@ -75,13 +75,16 @@ class EventForm(PermissionRequiredMixin, mixins.EventDetailMixin,
|
||||
class EventGallery(generic.ListView):
|
||||
"""Display a overview of all event photo albums."""
|
||||
template_name = 'events/photo_gallery.html'
|
||||
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')
|
||||
paginate_by = 24
|
||||
return queryset
|
||||
|
||||
|
||||
class EventListIcal(generic.View):
|
||||
@@ -177,10 +180,9 @@ class EventSeriesForm(mixins.EventDetailMixin, PermissionRequiredMixin,
|
||||
InlineFormSetView):
|
||||
model = models.Event
|
||||
inline_model = models.Event
|
||||
fk_name = 'event_series'
|
||||
fields = ('start', 'end')
|
||||
form_class = forms.EventForm
|
||||
extra = 3
|
||||
factory_kwargs = {'extra': 3, 'fk_name': 'event_series'}
|
||||
permission_required = 'events.add_event'
|
||||
template_name = 'events/eventseries_form.html'
|
||||
|
||||
@@ -192,5 +194,7 @@ class EventSeriesForm(mixins.EventDetailMixin, PermissionRequiredMixin,
|
||||
|
||||
|
||||
class UpcomingEvents(generic.ListView):
|
||||
queryset = models.Event.objects.upcoming(limit=None)
|
||||
paginate_by = 16
|
||||
|
||||
def get_queryset(self):
|
||||
return models.Event.objects.upcoming(limit=None)
|
||||
|
||||
Reference in New Issue
Block a user