I have a custom widget that I would like to make available to a Django Admin page. This is easily implemented using the formfield_overrides
attribute of a ModelAdmin
subclass, and using the Media
child class, I can define the necessary JavaScript and CSS for this widget. This works rather well. The only issue is that my custom widget requires MooTools to function properly, which seems to conflict with jQuery and breaks the default Django Admin widgets (namely date and time pickers).
I think both MooTools and jQuery modify Object.prototype
, and since MooTools gets loaded after jQuery, it seems to be overriding jQuery's modifications. DateTimeShortcuts.init()
, which is responsible for rendering the date and time picker buttons, does not get called automatically if MooTools is loaded.
I am sort of in a pickle here, because I want to be able to use the built-in admin widgets, but my custom widget is just as important, if not more so. The widget is used throughout my application, which uses MooTools, so I can't change frameworks, amd I'd rather not maintain two widgets that perform the same function using different frameworks.. Does anyone have any suggestions as to how I can get around this conflict?