-
Notifications
You must be signed in to change notification settings - Fork 48
Closed
Description
for some things, such as integration with DjangoRESTFramework, it would be nice if, in addition to the @inertia('ClientSidePage') decorator, support for class based views could be added.
My recommendation is to provide a mix-in (as shown here), which might be used like this:
from django.views import View
from inertia import InertiaMixin
class AsdfView(InertiaMixin, View):
component = "Asdf"
def get(self, request):
return { "message": "asdf" }If you're careful, then the mixin could function by internally decorating each method function with @inertia("Asdf") - though bear in mind these method functions take the View instance as the first arg, so chaperoning the mixin is necessary.
Metadata
Metadata
Assignees
Labels
No labels