<input type="datetime-local" name="{{ form.datefield.html_name }}" value="{{ form.datefield.value|date:"Y-m-d\TH:i" }}" id="{{ form.datefield.id_for_label }} " class="form-control">
def __str___(self):
qs = Bar.objects.filter(...
result = [str(x) for x in qs]
return '%s' % (result.join(','))
'list' object has no attribute 'join'
return '%s' % (result)
['value1', 'value2', 'value3']
','.join(result)
<script>
var django = django || {};
django.jQuery = jQuery;
$ = django.jQuery
</script>
form = TeamForm(request.POST or None)
print(form.media)
return render(request, 'template.html', locals())
<link href="/static/admin/css/widgets.css" type="text/css" media="all" rel="stylesheet" />
<script type="text/javascript" src="/static/admin/js/core.js"></script>
<script type="text/javascript" src="/static/admin/js/SelectBox.js"></script>
<script type="text/javascript" src="/static/admin/js/SelectFilter2.js"></script>
<script type="text/javascript" src="/admin/jsi18n/"></script>
{% block form %}
{{ form }}
{% endblock %}
{{ form.media }}
<select name="employees" required="" id="id_employees" multiple="multiple" class="selectfilter" data-field-name="verbose name" data-is-stacked="0">
<option value="1">...</option>
</select>
<select name="employees" required="" id="id_employees" multiple="multiple">
<option value="1">...</option>
</select>
admin/js/jquery.init.js
class MyDateTimeField(forms.DateTimeField):
def __init__(self, *args, **kwargs):
self.widget = DateInput(attrs={'type': 'datetime-local'})
self.input_formats = ['%Y-%m-%dT%H:%M']
self.initial = format(datetime.date.today(), '%Y-%m-%dT%H:%M')
self.localize = True
self.required = False
return super(MyDateTimeField, self).__init__(*args, **kwargs)
class MyDateTimeField(forms.DateTimeField):
def __init__(self, *args, **kwargs):
kwargs.setdefault('input_formats', ['%Y-%m-%dT%H:%M'])
kwargs.setdefault('widget',DateInput(attrs={'type': 'datetime-local'}))
kwargs.setdefault('initial', format(datetime.date.today(), '%Y-%m-%dT%H:%M'))
kwargs.setdefault('localize', True)
kwargs.setdefault('required', False)
super(MyDateTimeField, self).__init__(*args, **kwargs)
Android SDK не позволяет "записать" текущее воспроизводимое фоновое аудио чужого приложения?