Resolve "Implement backend Parent-Child relation for feedback"
Closes #552 (closed)
Changes:
feedback.py
- get: Added parent parameter and children parameter in the returned object. (children is a list of FO ids)
- post: Added parent as an argument added to the created feedback option
- put: Added parent as an argument in the returned data (parent cannot be modified).
database.py
- FeedbackOption: Add 'parent_id' column (type:int (fk feedback option), can be nullable)
- FeedbackOption: Add 'children' relationship (self-referential one-to-many relationship)
test_feedback.py
Add 7 tests:
- Create a FO without a parent
- Create a FO with a parent
- Delete a FO without a parent
- Delete a FO with a parent
- Delete a FO with 1 child
- Delete a FO with 2 levels of children (children and sub-children)
- Get the children of a FO
Edited by Waded Oudhuis