<s> from django import forms <EOL> from django . contrib . admin . widgets import AdminSplitDateTime <EOL> import object_tools <EOL> class TestForm ( forms . Form ) : <EOL> pass <EOL> class TestMediaForm ( forms . Form ) : <EOL> media_field = forms . fields . DateTimeField ( <EOL> widget = AdminSplitDateTime , <EOL> ) <EOL> class TestTool ( object_tools . ObjectTool ) : <EOL> name = '<STR_LIT>' <EOL> label = '<STR_LIT>' <EOL> form_class = TestForm <EOL> def view ( self , request , extra_context = None ) : <EOL> pass <EOL> class TestMediaTool ( object_tools . ObjectTool ) : <EOL> name = '<STR_LIT>' <EOL> label = '<STR_LIT>' <EOL> form_class = TestMediaForm <EOL> def view ( self ) : <EOL> pass <EOL> class TestInvalidTool ( object_tools . ObjectTool ) : <EOL> pass <EOL> try : <EOL> from django . apps import config <EOL> except ImportError : <EOL> config = None <EOL> if config : <EOL> def ready ( cls ) : <EOL> object_tools . tools . register ( TestTool ) <EOL> object_tools . tools . register ( TestMediaTool ) <EOL> object_tools . apps . ObjectToolsAppConfig . ready = ready <EOL> else : <EOL> object_tools . tools . register ( TestTool ) <EOL> object_tools . tools . register ( TestMediaTool ) </s>
