2024-03-25 22:52:53 +00:00
|
|
|
import random
|
|
|
|
|
|
|
|
|
|
from django.views import generic
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class View(generic.TemplateView):
|
2024-03-26 12:44:19 +00:00
|
|
|
"""Defines a common set of data to be passed to the template context."""
|
|
|
|
|
|
2024-03-25 22:52:53 +00:00
|
|
|
def get_context_data(self, **kwargs):
|
|
|
|
|
return {
|
|
|
|
|
**super().get_context_data(**kwargs),
|
2024-03-26 12:18:47 +00:00
|
|
|
"header_emoji": random.choice(
|
|
|
|
|
["🍔", "🍕", "🍟", "🥪", "🥘", "🍰", "🍻", "🧁", "🍞", "🥯", "🥐"]
|
|
|
|
|
),
|
2024-03-25 22:52:53 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class FormView(View, generic.FormView):
|
2024-03-26 12:44:19 +00:00
|
|
|
"""Functions the same as `moku.views.base.View` but for rendering forms."""
|
|
|
|
|
|
2024-03-25 22:52:53 +00:00
|
|
|
pass
|