-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bella/classes #141
Bella/classes #141
Conversation
…added activity and gym rresolvers to the schema
… and price resolver in Activity class
…added activity and gym rresolvers to the schema
… and price resolver in Activity class
…nto bella/activity
… into bella/activity
id = Column(Integer, primary_key=True) | ||
name = Column(String(), nullable=False) | ||
description = Column(String(), nullable=False) | ||
gyms = relationship("ClassInstance", back_populates="class_") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why does gyms reference the class_ field in ClassInstsance?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the naming is pretty confusing but basically this is where we relate the table "Class" with the name and description of the class to the table "ClassInstance" which is essentially the join table in our many to many relationship between classes and gyms with additional info in the table (i.e. location, instructor, isCanceled, etc). So, in the line of code you are talking about the field "gyms" is associated with many ClassInstance entries in the table, each of has its own "gym_id". Meaning that by the "gyms" field in "Class" being associated with many "ClassInstances" through the "class_" field, it is indirectly associated with many gyms via the "gym_id" in the table for each "class_" entry, hence why it is called "gyms" in the line of code above. What do you think @kidzegeye since you wrote it lol
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh okay I see, that makes sense.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me!
Implement Group Classes Scraper
Overview
Added back classes models to support classes feature. Added back scraper for classes on Cornell Recreation Website. Also added it to the scheduler to scrape classes every hour.
Changes Made
Created new file with classes models from previous PR. Used Beautiful Soup to scrape classes table on CFC website and populate the models (also from previous PR). Added scraper to scheduler. *Note: I had to scrape classes before anything else because otherwise there was an issue with initializing the database.
Test Coverage
Manually tested the feature using pgAdmin to ensure that the models were populated with the correct data from the CFC website.
Related PRs or Issues (delete if not applicable)
#110
#116