yaakovLowenstein / hx-requests

A package to facilitate the use of HTMX with Django
MIT License
55 stars 6 forks source link

Allow hx_requests to be nested in hx_requests directory #125

Open yaakovLowenstein opened 1 month ago

p-baum commented 1 month ago

Just stumbled across this project. Looks very interesting. One of my first concerns is hx_requests.py getting quickly unmanageable.

p-baum commented 1 month ago

Couldn't we just import our own module in the views file

from hx_requests.views import HtmxViewMixin
from django.views.generic.base import View
from myapp.views.user import hx_requests

class MyView(HtmxViewMixin, View):
    hx_requests_module = hx_requests

send it to BaseHXRequest and have it call getattr(self.hx_requests_module, name)

yaakovLowenstein commented 1 month ago

Thanks for taking time to look at the package!

I think I would mimic django views and make it that you can have a directory named hx_requests and have as many files in there as you want. Not too difficult, just haven't got around to it yet.