In models.py
I have
class myModel:
period = models.CharField(max_length = 100, blank=True)
the period
should contain something like: DD:HH:MM:SS
.
In the HTML template, I want this field to be in four different textbox input fields. Is there a way to do this in Django?
This is well documented: you need to create a subclass of forms.MultiValueField, which implements a compress
method which returns the combined value of the fields. Note that there is already a SplitDateTimeField, but that just have two separate fields for each of the date and time.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With