Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Python Django ORM Basic ORM Usage Bulk create

Heidi Ulrich
Heidi Ulrich
4,624 Points

What is the question here?

Up to here, the tasks were pretty straightforward. However, this one is too undefined for me to carry out.

Is the function fix_25 already there? Should I call it with fix_25.bulk_create() ? Also, what kind of a name is fix_25?

If someone would hand me an instruction like this IRL, I'd sit with them once more and figure out what they're actually trying to accomplish.

1 Answer

Chris Howell
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Chris Howell
Python Web Development Techdegree Graduate 49,702 Points

I dont know if you have already gotten past this challenge or if you are still stuck. Sorry it went so long without an answer.

Challenge is basically asking you to accomplish this task:

In a function named fix_25, can you use the bulk_create method to make three Reviews for the Product with an id of 1? They should have ratings of 2, 3, and 5. Thanks!

This function does not already exist, so its one you will write. And inside it you will be writing the logic to perform a "Bulk Create" into the Reviews model. You can hard code the product id in each of the items and the ratings as well.

This script is simply trying to simulate an "Accidental deletion" and you are trying to put a quick script together to put some entries back into a database.