-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Render form will always render default template #140
Comments
I would have to step through with the debugger, but usually you would use the Bootstrap |
I agree to the reference. It is what I use, but when I check the rendered html, each field group follows ... which in turn, fails to create the inline formatting of labels and inputs as referenced here This is due to the implementation of So I'm not sure if the |
Can you please create a small example. Take the examples in |
Investigatory diff:
<!-- snippet -->
<div role="group" class="dj-required row mb-3">
<label for="id_name" class="col-sm-3">Team name:</label><input type="text" name="name" maxlength="50" required="" form="id_customrendererteamform" id="id_name" class="form-control">
<div role="alert" class="dj-field-errors">
<meta name="error-messages" value_missing="This field is required." too_long="Ensure this value has at most 50 characters." bad_input="Null characters are not allowed.">
<ul class="dj-errorlist">
<li class="dj-placeholder"></li>
</ul>
</div>
<div class="dj-help-text">The name of the team</div>
</div> Overridden diff:
<!-- snippet -->
<div role="group" class="row mb-3 dj-required">
<label for="id_name" class="col-sm-3">
Team name:</label>
<div class="col-sm-9">
<input type="text" name="name" maxlength="50" required="" form="id_customrendererteamform" id="id_name" class="form-control">
<div role="alert" class="dj-field-errors">
<meta name="error-messages" value_missing="This field is required." too_long="Ensure this value has at most 50 characters." bad_input="Null characters are not allowed.">
<ul class="dj-errorlist">
<li class="dj-placeholder"></li>
</ul>
</div>
<div class="form-text text-muted">The name of the team</div>
</div>
</div> Some Notes:
Hopefully implementation is readable enough! |
Issue
I found that using the templatetag
render_form
will ignore the form renderer I declared in forms.py when I implement my project as follows:and template:
Clarification
I'm not sure if this is correct since I'm still checking this out:
https://github.com/jrief/django-formset/blob/e12c947a519ce84510b15df07030ac2c77df2a39/formset/templatetags/formsetify.py#L49C1-L52C66
It's causing rendering issues on my project since my ModelForm.default_renderer is bootstrap-based renderer,
while
{% render_form form %}
forces to useformset/default/form.html
instead offormset/bootstrap/form.html
The text was updated successfully, but these errors were encountered: