Canvas Link
https://learning.flatironschool.com/courses/6049/assignments/215798?module_item_id=501683
Concern
Hello!
Should Dev.give_away and Company.give_freebie also contain the session parameter so that they can save the results to the database? Or is it assumed that the methods will return instances that will then be added/committed to the session in ipdb?
Dev.give_away(dev, freebie) accepts a Dev instance and a Freebie instance, changes the freebie's dev to be the given dev; your code should only make the change if the freebie belongs to the dev who's giving it away
It seems like there should be a change in the database by running this method, however we don't pass in session so I am unsure how to add / commit changes.
Company.give_freebie(dev, item_name, value) takes a dev (an instance of the Dev class), an item_name (string), and a value as arguments, and creates a new Freebie instance associated with this company and the given dev.
This does say to return an instance but I find it to be inconsistent with Dev.give_away to not make the change directly to the database as well.
Ultimately I think both methods should either return the instances and it should be up to the user to session.add/commit in ipdb OR both methods should take in session as a parameter and session.add/commit directly in the method.
Additional Context
No response
Suggested Changes
No response
Canvas Link
https://learning.flatironschool.com/courses/6049/assignments/215798?module_item_id=501683
Concern
Hello!
Should Dev.give_away and Company.give_freebie also contain the session parameter so that they can save the results to the database? Or is it assumed that the methods will return instances that will then be added/committed to the session in ipdb?
Dev.give_away(dev, freebie) accepts a Dev instance and a Freebie instance, changes the freebie's dev to be the given dev; your code should only make the change if the freebie belongs to the dev who's giving it awayIt seems like there should be a change in the database by running this method, however we don't pass in session so I am unsure how to add / commit changes.
Company.give_freebie(dev, item_name, value) takes a dev (an instance of the Dev class), an item_name (string), and a value as arguments, and creates a new Freebie instance associated with this company and the given dev.This does say to return an instance but I find it to be inconsistent with Dev.give_away to not make the change directly to the database as well.
Ultimately I think both methods should either return the instances and it should be up to the user to session.add/commit in ipdb OR both methods should take in session as a parameter and session.add/commit directly in the method.
Additional Context
No response
Suggested Changes
No response