code: def media(self, form):
          
          js = ['admin/js/core.js', 'admin/js/admin/RelatedObjectLookups.js',
                'admin/js/jquery.min.js', 'admin/js/jquery.init.js']
  
          media = forms.Media(
              js=['%s%s' % (settings.STATIC_URL, u) for u in js],
          )
  
          if form:
              for name, field in form.fields.items():
                  media = media + field.widget.media
  
          return media
docs: Collects admin and form media.