A way to render a separate field
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 28/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- javascript
- Lĩnh vực
- backend
Hướng nghiên cứu
Start with the form.fields.q.toHTML() and boundForm.fields.q.toHTML() entry points described in the issue, then review the discussion and the Django forms customization reference. Done should provide a supported way to render only the input field, including the submitted value for bound fields, without the surrounding label and div.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
In many cases it is easier to render the form manually in the template file. Consider a simple form:
var form = forms.create({
q: forms.fields.string()
});
form.handle(req, {
other: function (boundForm) {
...
I want to render that field in my template in a custom hand-crafted layout. Supposedly, form.fields.q.toHTML() and boundForm.fields.q.toHTML() should render the input field only (with the pre-filled submitted value in latter case), but instead they render the entire line with unwanted extra tags:
<div class="field"><label for="id_q">Q</label><input type="text" name="q" id="id_q" /></div>
You can take a look on the degree of freedom in Django forms engine:
https://docs.djangoproject.com/en/dev/topics/forms/#customizing-the-form-template
- Ngôn ngữ chính
- JavaScript
- Star
- 1k
- Fork
- 160
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của caolan/forms
-
Feature Requests Needs More Info
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
-
Cut a new release?Đang mở
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 20/100
-
Feature Requests pull request wanted
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 45/100
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 25/100
-
simple checkboxĐang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 30/100
Issue tương tự
-
Access-request approve silently discards the decider's note (decision_note written only on deny)Đang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Uuriko/project-room#3378 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Notifications pagination accepts NaN and negative LIMIT/OFFSETCó thể đã có người làm @Senthil455 đã nhận hôm nay. Đang mởBUGS MEDIUM
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
elixpo/blogs.elixpo#419 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
immich-app/immich#32426 ·
Maintainer thường phản hồi trong vòng 1 ngày