Suppose I have a model with DateTimeField
.
And for DateTimeField
, currently admin input is:
Is it possible to customize it to
You can do that by overriding the admin css. You basically have to .vDateField
, .vTimeField
elements.
Create a template admin/change_form.html
in your templates folder. Add the following lines to that file
{% extends "admin/change_form.html" %}
{% block extrastyle %}
.vDateField, .vTimeField {
display: block;
}
{% endblock %}
Django picks up this file, reads it and processes it before processing the original template file.