Changeset 7615
- Timestamp:
- 06/11/08 09:01:35 (3 months ago)
- Files:
-
- django/trunk/django/core/management/commands/dumpdata.py (modified) (2 diffs)
- django/trunk/docs/django-admin.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
django/trunk/django/core/management/commands/dumpdata.py
r7294 r7615 10 10 make_option('--indent', default=None, dest='indent', type='int', 11 11 help='Specifies the indent level to use when pretty-printing output'), 12 make_option('-e', '--exclude', dest='exclude',action='append', default=[], 13 help='App to exclude (use multiple --exclude to exclude multiple apps).'), 12 14 ) 13 15 help = 'Output the contents of the database as a fixture of the given format.' … … 17 19 from django.db.models import get_app, get_apps, get_models 18 20 19 format = options.get('format', 'json') 20 indent = options.get('indent', None) 21 show_traceback = options.get('traceback', False) 21 format = options['format'] 22 indent = options['indent'] 23 exclude = options['exclude'] 24 show_traceback = options['traceback'] 25 26 excluded_apps = [get_app(app_label) for app_label in exclude] 22 27 23 28 if len(app_labels) == 0: 24 app_list = get_apps()29 app_list = [app for app in get_apps() if app not in excluded_apps] 25 30 else: 26 31 app_list = [get_app(app_label) for app_label in app_labels] django/trunk/docs/django-admin.txt
r7614 r7615 164 164 165 165 .. _custom manager: ../model-api/#custom-managers 166 167 --exclude 168 ~~~~~~~~~ 169 170 **New in Django development version** 171 172 Exclude a specific application from the applications whose contents is 173 output. For example, to specifically exclude the `auth` application from 174 the output, you would call:: 175 176 django-admin.py dumpdata --exclude=auth 177 178 If you want to exclude multiple applications, use multiple ``--exclude`` 179 directives:: 180 181 django-admin.py dumpdata --exclude=auth --exclude=contenttype 166 182 167 183 --format
