=== modified file 'django/newforms/forms.py'
--- django/newforms/forms.py	2007-09-15 22:25:52 +0000
+++ django/newforms/forms.py	2007-09-16 23:35:24 +0000
@@ -9,7 +9,7 @@
 from django.utils.encoding import StrAndUnicode, smart_unicode, force_unicode
 
 from fields import Field
-from widgets import Media, media_property, TextInput, Textarea
+from widgets import Media, MediaDefiningClass, TextInput, Textarea
 from util import flatatt, ErrorDict, ErrorList, ValidationError
 
 __all__ = ('BaseForm', 'Form')
@@ -33,7 +33,7 @@
     def copy(self):
         return SortedDictFromList([(k, copy.deepcopy(v)) for k, v in self.items()])
 
-class DeclarativeFieldsMetaclass(type):
+class DeclarativeFieldsMetaclass(MediaDefiningClass):
     """
     Metaclass that converts Field attributes to a dictionary called
     'base_fields', taking into account parent class 'base_fields' as well.
@@ -52,16 +52,14 @@
 
         attrs['base_fields'] = SortedDictFromList(fields)
 
-        new_class = type.__new__(cls, name, bases, attrs)
-        if 'media' not in attrs:
-            new_class.media = media_property(new_class)
-        return new_class
+        return MediaDefiningClass.__new__(cls, name, bases, attrs)
 
 class BaseForm(StrAndUnicode):
     # This is the main implementation of all the Form logic. Note that this
     # class is different than Form. See the comments by the Form class for more
     # information. Any improvements to the form API should be made to *this*
     # class, not to the Form class.
+    __metaclass__ = MediaDefiningClass
     def __init__(self, data=None, files=None, auto_id='id_%s', prefix=None,
             initial=None, error_class=ErrorList):
         self.is_bound = data is not None or files is not None

=== modified file 'tests/modeltests/model_forms/models.py'
--- tests/modeltests/model_forms/models.py	2007-09-15 22:25:52 +0000
+++ tests/modeltests/model_forms/models.py	2007-09-16 23:58:44 +0000
@@ -207,6 +207,17 @@
 >>> f.say_hello()
 hello
 
+You can define media class on base form.
+>>> class FormWithMedia(BaseForm):
+...     class Media:
+...         js = ['form.js']
+...         css = {'all': ['form.css']}
+>>> CategoryFormWithMedia = form_for_model(Category, form=FormWithMedia)
+>>> f = CategoryFormWithMedia()
+>>> print f.media
+<link href="form.css" type="text/css" media="all" rel="stylesheet" />
+<script type="text/javascript" src="form.js"></script>
+
 Use form_for_instance to create a Form from a model instance. The difference
 between this Form and one created via form_for_model is that the object's
 current values are inserted as 'initial' data in each Field.

