How to access SubFields MultiValueField in a template

I am trying to get a nice present from the DatTime collector after this approach . So I have a subclass of MultiValueField with two SubFields and a widget that is a subclass of MultiWidget and which passes the correct css classes to its slots to make JQueryUI mark one of the inputs as a date picker. Now I want to access the received SubFields MultiValueField separately in my templates, rendering them in different places of the table.
But I do not see a way to solve them. Which object should I reference in the template?
Depending on what I use in my template, I can access most of the object, but none of them display in HTML. All I can get is the default str () output for objects.

For example, form.date_time.field.time_field.widget "displays" in <django.forms.widgets.TimeInput object at 0x7fe018033f90>

Access to the fields in question gives similar results.

Did I miss something obvious here?

+4
source share

Source: https://habr.com/ru/post/1438735/


All Articles