Sunday, November 27, 2016

DateTimeField Outside Admin



Good afternoon people,

I would like to display my date field outside the admin in the same way it displays, ie an option for date and another for time, as in the figure below.







I looked in the documentation but I did not understand much, I searched the webmas not found anything without using other libraries.

A friend sent a tip and also did not work because it presents the error:

'Str' object has no attribute 'input_formats'

Finally I found an ancient good:

Open on page 198 onwards.

But even so he does not even carry the field.

Can someone show me an example of how I would do this?

If possible post as would be the model, the form and the hrml.

Thank you.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/47f0afd0-c988-4924-9c37-a9c4254f969b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment