diff --git a/scripts/create_books.py b/scripts/create_books.py index 7939945..1815725 100644 --- a/scripts/create_books.py +++ b/scripts/create_books.py @@ -13,12 +13,13 @@ def run(): books = json.loads(file_books.read()) # Create books - for book in books: + for index, book in enumerate(books): Book( + id=index + 1, title=book['title'], author=book['author'], country=book['country'], year=book['year'], ).save() - print('Finish!') \ No newline at end of file + print('Finish!')