yaakovLowenstein / hx-requests

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

Adjust hx requests to follow Django views #114

Open yaakovLowenstein opened 1 month ago

yaakovLowenstein commented 1 month ago

Object Attribute in Detail View:

In Django’s DetailView, the object is accessed with self.object, but hx_requests uses hx_object, which feels unnecessary and confusing.

Method Signatures:

Django CBVs convert kwargs into view attributes automatically, making them easy to access. hx_requests passes **kwargs directly into methods, which doesn’t align with how Django does things.

Form Handling:

Django passes the form instance to form_valid and form_invalid, which makes handling forms straightforward. hx_requests instead sets self.form instead of passing the form to the appropriate form handlers.

Model and Fields Definition for Form Views:

Django FormView allows setting model and fields in the Meta class, but hx_requests forces the creation of a custom form class, adding unnecessary steps.

yaakovLowenstein commented 1 month ago

Taken from https://github.com/yaakovLowenstein/hx-requests/issues/112

yaakovLowenstein commented 1 month ago