def handle(self, *args, **options): try: csv_file = open(args[0]) except IndexError: raise CommandError("You must provide a CSV file argument") reader = csv.DictReader(csv_file) bulk_create(reader) csv_file.close()
def stories_in_database(step): bulk_create(step.hashes)