

get_public_serializer_formats (): raise CommandError ( "Unknown serialization format: %s " % format ) try : serializer_class = serializers. append ( model ) else : app_list = except ValueError : # This is just an app - no model qualifier app_label = label try : app = get_app ( app_label ) except Improperl圜onfigured : raise CommandError ( "Unknown application: %s " % app_label ) app_list = None # Check that the serialization format exists this is a shortcut to # avoid collating all the objects and _then_ failing.

keys (): if app_list and model not in app_list : app_list. %s " % ( app_label, model_label )) if app in app_list. split ( '.' ) try : app = get_app ( app_label ) except Improperl圜onfigured : raise CommandError ( "Unknown application: %s " % app_label ) model = get_model ( app_label, model_label ) if model is None : raise CommandError ( "Unknown model: %s. INFO ) excluded_apps = if len ( app_labels ) = 0 : app_list = SortedDict () else : app_list = SortedDict () for label in app_labels : try : app_label, model_label = label. get ( 'exclude' ,) show_traceback = options.

get ( 'indent', None ) exclude = options. get ( 'format', 'json' ) indent = options. Streams to avoid MemoryErrors.' args = '' def handle ( self, * app_labels, ** options ): from django.db.models import get_app, get_apps, get_models, get_model format = options. option_list + ( make_option ( '-format', default = 'json', dest = 'format', help = 'Specifies the output serialization format for fixtures.' ), make_option ( '-indent', default = None, dest = 'indent', type = 'int', help = 'Specifies the indent level to use when pretty-printing output' ), make_option ( '-e', '-exclude', dest = 'exclude', action = 'append', default =, help = 'App to exclude (use multiple -exclude to exclude multiple apps).' ), ) help = 'Output the contents of the database as a fixture of the given format. From snippet 1401 import serialize_qs4e from import Improperl圜onfigured from import BaseCommand, CommandError from re import serializers from import SortedDict import logging import sys from optparse import make_option class Command ( BaseCommand ): option_list = BaseCommand.
