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.
The object I hear making self.object but it would still need to be passed into the template as hx_object to not conflict with a potential object from the view since the context is also used from the view
I'm not sure about this either because kwargs are more used in hx requests than views so I feel like you might want it as part of the method signature so more obvious whats accessible
This makes lots of sense
This gets into bigger discussion of adding a Create/ Update / Form and createUpdate hx request to the package, which I think makes sense
@sgordon16 what do you think since this comes from your issue?
Object Attribute in Detail View:
In Django’s DetailView, the object is accessed with
self.object
, buthx_requests
useshx_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 setsself.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, buthx_requests
forces the creation of a custom form class, adding unnecessary steps.