Commit 7e4c7031 authored by Sébastiaan Versteeg's avatar Sébastiaan Versteeg
Browse files

Limit possible events for pizzas to future or today

parent 4b621377
from django.contrib import admin
from django.urls import reverse
from django.utils import timezone
from django.utils.html import format_html
from django.utils.translation import ugettext_lazy as _
from .models import Order, PizzaEvent, Product
from events.models import Event
......@@ -17,6 +19,13 @@ class PizzaEventAdmin(admin.ModelAdmin):
def formfield_for_foreignkey(self, db_field, request, **kwargs):
if == "event":
kwargs["queryset"] = Event.objects.filter(
return super(PizzaEventAdmin, self).formfield_for_foreignkey(
db_field, request, **kwargs)
class OrderAdmin(admin.ModelAdmin):
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment