viewflow / django-material

Material Design for Django
http://viewflow.io/
BSD 3-Clause "New" or "Revised" License
2.49k stars 424 forks source link

VariableDoesNotExist - error in \material\templates\material\fields\django_datetimeinput.html #497

Closed robertkowalski1974 closed 3 years ago

robertkowalski1974 commented 3 years ago

Template does not render any DateTimeField type.

Model:

class Wtn(models.Model): form_id = models.IntegerField() form_name = models.CharField(max_length=250) submitted_on = models.DateTimeField(blank = True, null=True, default = timezone.now)

Then get following error in \material\templates\material\fields\django_datetimeinput.html, error at line 19 {% if bound_field.value %}value="{{ bound_field.value|datepicker_value:field.input_formats.0 }}"{% endif%}``

Is it related to #495 ?

If I will remove DateTimeField from model all works fine.

kmmbvnr commented 3 years ago

Thank you for reporting! fixed

robertkowalski1974 commented 3 years ago

Hello. I have not made extensive tests, but now error is

strftime() argument 1 must be str, not DateTimeField

Will have a look later why it is there.

robertkowalski1974 commented 3 years ago

All good. Thank you for quick fix.