Hello (please excuse me for my bad english ;) ),
Imagine the classes bellow:
models.py
from django import models
class MyModel(models.Model):
content_type = models.ForeignKey(ContentType, verbose_name=_('content type'))
object_id = models.PositiveIntegerField(_('object id'))
content_object = generic.GenericForeignKey('content_type', 'object_id')
published_at = models.DateTimeField()
forms.py
from django import forms
class MyModelForm(forms.ModelForm):
published_at = forms.DateTimeField(required=False, widget=DateTimeInput)
admin.py
from django.contrib import admin
form django.contrib.contenttypes import generic
class MyModelInline(generic.GenericStackedInline):
model = MyModel
form = MyModelForm
class MyModelAdmin(admin.ModelAdmin):
inlines = [MyModelInline]
Problem: the <script>
tags for javascript from the DateTimeInput widget don't appear in the admin site (adding a new MyModel object). i.e. these two lines :
<script type="text/javascript" src="/admin/media/js/calendar.js"></script>
<script type="text/javascript" src="/admin/media/js/admin/DateTimeShortcuts.js"></script>
Please, do you have any idea to fix it ?
Thank you very much and have a good day :)