Commit 5420e848 authored by Thom Wiggers's avatar Thom Wiggers 📐
Browse files

Merge branch 'feature/138-events-for-pizza' into 'master'

Limit possible events for pizzas to future or today

Closes #138

See merge request !178
parents 07d802fd 7e4c7031
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