diff --git a/django/core/management/validation.py b/django/core/management/validation.py
index 97164d7..185edd1 100644
--- a/django/core/management/validation.py
+++ b/django/core/management/validation.py
@@ -53,6 +53,8 @@ def get_validation_errors(outfile, app=None):
                     e.add(opts, '"%s": To use ImageFields, you need to install the Python Imaging Library. Get it at http://www.pythonware.com/products/pil/ .' % f.name)
             if isinstance(f, models.BooleanField) and getattr(f, 'null', False):
                 e.add(opts, '"%s": BooleanFields do not accept null values. Use a NullBooleanField instead.' % f.name)
+            if isinstance(f, models.FilePathField) and not (f.allow_files or f.allow_folders):
+                e.add(opts, '"%s": FilePathFields must have either allow_files or allow_folders set to True.' % f.name)
             if f.choices:
                 if isinstance(f.choices, basestring) or not is_iterable(f.choices):
                     e.add(opts, '"%s": "choices" should be iterable (e.g., a tuple or list).' % f.name)
diff --git a/django/db/models/fields/__init__.py b/django/db/models/fields/__init__.py
index 05238cf..95cf61a 100644
--- a/django/db/models/fields/__init__.py
+++ b/django/db/models/fields/__init__.py
@@ -1,12 +1,9 @@
 import copy
 import datetime
+import decimal
 import os
 import re
 import time
-try:
-    import decimal
-except ImportError:
-    from django.utils import _decimal as decimal    # for Python 2.3
 
 from django.db import connection
 from django.db.models import signals
@@ -671,8 +668,10 @@ class EmailField(CharField):
 class FilePathField(Field):
     """File path"""
     
-    def __init__(self, verbose_name=None, name=None, path='', match=None, recursive=False, **kwargs):
+    def __init__(self, verbose_name=None, name=None, path='', match=None,
+        recursive=False, allow_files=True, allow_folders=False, **kwargs):
         self.path, self.match, self.recursive = path, match, recursive
+        self.allow_files, self.allow_folders =  allow_files, allow_folders
         kwargs['max_length'] = kwargs.get('max_length', 100)
         Field.__init__(self, verbose_name, name, **kwargs)
 
@@ -682,6 +681,8 @@ class FilePathField(Field):
             'match': self.match,
             'recursive': self.recursive,
             'form_class': forms.FilePathField,
+            'allow_files': self.allow_files,
+            'allow_folders': self.allow_folders,
         }
         defaults.update(kwargs)
         return super(FilePathField, self).formfield(**defaults)
diff --git a/django/forms/fields.py b/django/forms/fields.py
index 0aef355..db6ebd0 100644
--- a/django/forms/fields.py
+++ b/django/forms/fields.py
@@ -12,16 +12,8 @@ try:
     from cStringIO import StringIO
 except ImportError:
     from StringIO import StringIO
+from decimal import Decimal, DecimalException
 
-# Python 2.3 fallbacks
-try:
-    from decimal import Decimal, DecimalException
-except ImportError:
-    from django.utils._decimal import Decimal, DecimalException
-try:
-    set
-except NameError:
-    from sets import Set as set
 
 import django.core.exceptions
 from django.utils.translation import ugettext_lazy as _
@@ -822,10 +814,11 @@ class MultiValueField(Field):
         raise NotImplementedError('Subclasses must implement this method.')
 
 class FilePathField(ChoiceField):
-    def __init__(self, path, match=None, recursive=False, required=True,
-                 widget=None, label=None, initial=None, help_text=None,
-                 *args, **kwargs):
+    def __init__(self, path, match=None, recursive=False, allow_files=True,
+        allow_folders=False, required=True, widget=Select, label=None,
+        initial=None, help_text=None, *args, **kwargs):
         self.path, self.match, self.recursive = path, match, recursive
+        self.allow_files, self.allow_folders = allow_files, allow_folders
         super(FilePathField, self).__init__(choices=(), required=required,
             widget=widget, label=label, initial=initial, help_text=help_text,
             *args, **kwargs)
@@ -840,15 +833,23 @@ class FilePathField(ChoiceField):
 
         if recursive:
             for root, dirs, files in os.walk(self.path):
-                for f in files:
-                    if self.match is None or self.match_re.search(f):
-                        f = os.path.join(root, f)
-                        self.choices.append((f, f.replace(path, "", 1)))
+                if self.allow_files:
+                    for f in files:
+                        if self.match is None or self.match_re.search(f):
+                            f = os.path.join(root, f)
+                            self.choices.append((f, f.replace(path, "", 1)))
+                if self.allow_folders:
+                    for f in dirs:
+                        if self.match is None or self.match_re.search(f):
+                            f = os.path.join(root, f)
+                            self.choices.append((f, f.replace(path, "", 1)))
         else:
             try:
                 for f in os.listdir(self.path):
                     full_file = os.path.join(self.path, f)
-                    if os.path.isfile(full_file) and (self.match is None or self.match_re.search(f)):
+                    if (((self.allow_files and os.path.isfile(full_file)) or
+                        (self.allow_folders and os.path.isdir(full_file))) and
+                        (self.match is None or self.match_re.search(f))):
                         self.choices.append((full_file, f))
             except OSError:
                 pass
diff --git a/docs/ref/forms/fields.txt b/docs/ref/forms/fields.txt
index 4bb6a7c..74be0c6 100644
--- a/docs/ref/forms/fields.txt
+++ b/docs/ref/forms/fields.txt
@@ -523,6 +523,22 @@ extra arguments; only ``path`` is required:
     A regular expression pattern; only files with names matching this expression
     will be allowed as choices.
 
+.. attribute:: FilePathField.allow_files
+
+    .. versionadded:: 1.2
+
+    Optional.  Either ``True`` or ``False``.  Default is ``True``.  Specifies
+    whether files in the specified location should be included.  Either this or
+    :attr:`~FilePathField.allow_folders` must be ``True``.
+
+.. attribute:: FilePathField.allow_folders
+
+    .. versionadded:: 1.2
+
+    Optional.  Either ``True`` or ``False``.  Default is ``False``.  Specifies
+    whether folders in the specified location should be included.  Either this
+    or :attr:`~FilePathField.allow_files` must be ``True``.
+
 ``FloatField``
 ~~~~~~~~~~~~~~
 
diff --git a/docs/ref/models/fields.txt b/docs/ref/models/fields.txt
index 0cb5be4..fba9e07 100644
--- a/docs/ref/models/fields.txt
+++ b/docs/ref/models/fields.txt
@@ -571,6 +571,23 @@ directory on the filesystem. Has three special arguments, of which the first is
     Optional. Either ``True`` or ``False``. Default is ``False``. Specifies
     whether all subdirectories of :attr:`~FilePathField.path` should be included
 
+.. attribute:: FilePathField.allow_files
+
+    .. versionadded:: 1.2
+
+    Optional.  Either ``True`` or ``False``.  Default is ``True``.  Specifies
+    whether files in the specified location should be included.  Either this or
+    :attr:`~FilePathField.allow_folders` must be ``True``.
+
+.. attribute:: FilePathField.allow_folders
+
+    .. versionadded:: 1.2
+
+    Optional.  Either ``True`` or ``False``.  Default is ``False``.  Specifies
+    whether folders in the specified location should be included.  Either this
+    or :attr:`~FilePathField.allow_files` must be ``True``.
+
+
 Of course, these arguments can be used together.
 
 The one potential gotcha is that :attr:`~FilePathField.match` applies to the
diff --git a/tests/regressiontests/forms/fields.py b/tests/regressiontests/forms/fields.py
index c9736d3..c67e68f 100644
--- a/tests/regressiontests/forms/fields.py
+++ b/tests/regressiontests/forms/fields.py
@@ -24,22 +24,19 @@ Each Field's __init__() takes at least these parameters:
 Other than that, the Field subclasses have class-specific options for
 __init__(). For example, CharField has a max_length option.
 """
+
 import datetime
 import time
 import re
 import os
 
+from decimal import Decimal
 from unittest import TestCase
 
 from django.core.files.uploadedfile import SimpleUploadedFile
 from django.forms import *
 from django.forms.widgets import RadioFieldRenderer
 
-try:
-    from decimal import Decimal
-except ImportError:
-    from django.utils._decimal import Decimal
-
 
 def fix_os_paths(x):
     if isinstance(x, basestring):
@@ -815,6 +812,42 @@ class FieldsTests(TestCase):
         for exp, got in zip(expected, fix_os_paths(f.choices)):
             self.assertEqual(exp[1], got[1])
             assert got[0].endswith(exp[0])
+    
+    def test_filepathfield_folders(self):
+        path = forms.__file__
+        path = os.path.dirname(path) + '/'
+        f = FilePathField(path=path, allow_folders=True, allow_files=False)
+        f.choices.sort()
+        expected = [
+            ('/django/forms/extras', 'extras'),
+        ]
+        for exp, got in zip(expected, fix_os_paths(f.choices)):
+            self.assertEqual(exp[1], got[1])
+            self.assert_(got[0].endswith(exp[0]))
+        
+        f = FilePathField(path=path, allow_folders=True, allow_files=True)
+        f.choices.sort()
+        expected = [
+            ('/django/forms/__init__.py', '__init__.py'),
+            ('/django/forms/__init__.pyc', '__init__.pyc'),
+            ('/django/forms/extras', 'extras'),
+            ('/django/forms/fields.py', 'fields.py'),
+            ('/django/forms/fields.pyc', 'fields.pyc'),
+            ('/django/forms/forms.py', 'forms.py'),
+            ('/django/forms/forms.pyc', 'forms.pyc'),
+            ('/django/forms/formsets.py', 'formsets.py'),
+            ('/django/forms/formsets.pyc', 'formsets.pyc'),
+            ('/django/forms/models.py', 'models.py'),
+            ('/django/forms/models.pyc', 'models.pyc'),
+            ('/django/forms/util.py', 'util.py'),
+            ('/django/forms/util.pyc', 'util.pyc'),
+            ('/django/forms/widgets.py', 'widgets.py'),
+            ('/django/forms/widgets.pyc', 'widgets.pyc')
+        ]
+        for exp, got in zip(expected, fix_os_paths(f.choices)):
+            self.assertEqual(exp[1], got[1])
+            self.assert_(got[0].endswith(exp[0]))
+
 
     # SplitDateTimeField ##########################################################
 
