Canvas Link
https://learning.flatironschool.com/courses/6275/assignments/237710?module_item_id=558386
Concern
The instructions for the dliverables are not only confusing but in the wrong order.
Instructions begin here:
Design a Flask application that displays information from a database created using Flask-SQLAlchemy and Flask-Migrate.
flask db init has already been run. You will need to direct your Flask app to a database at app.db, create models, run a migration with flask db revision --autogenerate -m'' and create the database file with flask db upgrade.
Your database should represent a zoo. There should be three tables: animals, zookeepers, and enclosures.
The Animal model should contain a name, a species, a zookeeper, and an enclosure.
The Zookeeper model should contain a name, a birthday, and a list of animals that they take care of.
The Enclosure model should contain an environment (grass, sand, or water), an open_to_visitors boolean, and a list of animals.
Your application should contain three views: animal_by_id, zookeeper_by_id, and enclosure_by_id. Their routes should be animal/int:id, zookeeper/int:id, and enclosure/int:id, respectively.
Each view should display all attributes as line items (ul). If there is a one-to-many relationship, each of the many should have its own line item.
A seed script, server/seed.py, has been provided to generate test data once your models have been built and migrated to a database. Make sure to run this so that there are resources for the test suite to visit.
Additional Context
the task should be reordered.
Suggested Changes
It should be this for less confusion.
You actually cant run the test until your models are done
Your database should represent a zoo. There should be three tables: animals, zookeepers, and enclosures.
The Animal model should contain a name, a species, a zookeeper, and an enclosure.
The Zookeeper model should contain a name, a birthday, and a list of animals that they take care of.
The Enclosure model should contain an environment (grass, sand, or water), an open_to_visitors boolean, and a list of animals.
this step is already done
remove the following step -flask db init has already been run. You will need to direct your Flask app to a database at app.db, create models
because - the direction is already done this shouldnt even be in here
Run a migration with flask db revision --autogenerate -m'' and create the database file with flask db upgrade head
do this step next so you can actually have information for the test to work
A seed script, server/seed.py, has been provided to generate test data once your models have been built and migrated to a database. Make sure to run this so that there are resources for the test suite to visit.
Now running pytest -x will allow the test to generate instead of errors and you can finish this "test-driven-lab"*
Your application should contain three views: animal_by_id, zookeeper_by_id, and enclosure_by_id. Their routes should be animal/int:id, zookeeper/int:id, and enclosure/int:id, respectively.
Each view should display all attributes as line items (ul). If there is a one-to-many relationship, each of the many should have its own line item.
Canvas Link
https://learning.flatironschool.com/courses/6275/assignments/237710?module_item_id=558386
Concern
The instructions for the dliverables are not only confusing but in the wrong order.
Instructions begin here:
Design a Flask application that displays information from a database created using Flask-SQLAlchemy and Flask-Migrate.
flask db init has already been run. You will need to direct your Flask app to a database at app.db, create models, run a migration with flask db revision --autogenerate -m'' and create the database file with flask db upgrade.
Your database should represent a zoo. There should be three tables: animals, zookeepers, and enclosures.
The Animal model should contain a name, a species, a zookeeper, and an enclosure.
The Zookeeper model should contain a name, a birthday, and a list of animals that they take care of.
The Enclosure model should contain an environment (grass, sand, or water), an open_to_visitors boolean, and a list of animals.
Your application should contain three views: animal_by_id, zookeeper_by_id, and enclosure_by_id. Their routes should be animal/int:id, zookeeper/int:id, and enclosure/int:id, respectively.
Each view should display all attributes as line items (ul). If there is a one-to-many relationship, each of the many should have its own line item.
A seed script, server/seed.py, has been provided to generate test data once your models have been built and migrated to a database. Make sure to run this so that there are resources for the test suite to visit.
Additional Context
the task should be reordered.
Suggested Changes
It should be this for less confusion.
You actually cant run the test until your models are done
Your database should represent a zoo. There should be three tables: animals, zookeepers, and enclosures.
The Animal model should contain a name, a species, a zookeeper, and an enclosure.
The Zookeeper model should contain a name, a birthday, and a list of animals that they take care of.
The Enclosure model should contain an environment (grass, sand, or water), an open_to_visitors boolean, and a list of animals.
this step is already done
remove the following step -flask db init has already been run. You will need to direct your Flask app to a database at app.db, create models
because - the direction is already done this shouldnt even be in here
Run a migration with flask db revision --autogenerate -m'' and create the database file with flask db upgrade head
do this step next so you can actually have information for the test to work
A seed script, server/seed.py, has been provided to generate test data once your models have been built and migrated to a database. Make sure to run this so that there are resources for the test suite to visit.
Now running pytest -x will allow the test to generate instead of errors and you can finish this "test-driven-lab"*
Your application should contain three views: animal_by_id, zookeeper_by_id, and enclosure_by_id. Their routes should be animal/int:id, zookeeper/int:id, and enclosure/int:id, respectively.
Each view should display all attributes as line items (ul). If there is a one-to-many relationship, each of the many should have its own line item.