Пример #1
0
    def handle(self, *args, **options):
        super(Command, self).handle(*args, **options)
        courts = Court.objects.all()

        self.stdout.write('Starting bulk file creation.')
        t1 = now()
        write_json_to_disk(courts,
                           obj_type_str='full-dockets',
                           obj_class=Docket,
                           court_attr='court_id',
                           serializer=FullDocketSerializer,
                           bulk_dir=options['output_directory'])
        t2 = now()
        self.stdout.write("Completed in %s" % (t2 - t1))
    def handle(self, *args, **options):
        super(Command, self).handle(*args, **options)
        courts = Court.objects.all()

        for data_type in options['data_types']:
            kwargs = self.data_types[data_type]
            self.stdout.write("Starting bulk file creation of '%s'" %
                              kwargs['obj_type_str'])
            t1 = now()

            write_json_to_disk(courts, bulk_dir=options['output_directory'],
                               **kwargs)
            t2 = now()
            self.stdout.write("Completed in %s" % (t2 - t1))
Пример #3
0
    def handle(self, *args, **options):
        super(Command, self).handle(*args, **options)
        courts = Court.objects.all()

        for data_type in options["data_types"]:
            kwargs = self.data_types[data_type]
            self.stdout.write(
                f"Starting bulk file creation of '{kwargs['obj_type_str']}'")
            t1 = now()

            write_json_to_disk(courts,
                               bulk_dir=options["output_directory"],
                               **kwargs)
            t2 = now()
            self.stdout.write(f"Completed in {t2 - t1}")