如何在我的类BaseReserveFormSet中从我的url获取slug组织器?以前有人这样做过吗?我真的在努力解决这个问题。
BaseFormSet:
class BaseReserveFormSet(BaseFormSet):
def clean(self):
queryset = Organizer.objects.filter(
# MY PROBLEM: HOW DO I GET <slug:organizer> IN HERE?
slug='lorem-2',
)
max_qty_per_ticket = queryset.first().max_qty_per_ticket
urls.py
urlpatterns = [
path('<slug:organizer>/<slug:event>/', event_detail_view, name='event'),
]