Skip to content
Snippets Groups Projects
Commit 6a45c3ae authored by Adrian Block's avatar Adrian Block
Browse files

added instructors and ou to course

parent 8e224af3
No related branches found
No related tags found
1 merge request!3Dev
......@@ -52,6 +52,8 @@ class Course(Base):
cid = Column(VARCHAR(32), nullable=False)
name = Column(VARCHAR(256), nullable=False)
description = Column(VARCHAR(255), nullable=True)
instructors = Column(VARCHAR(256), nullable=False)
ou = Column(VARCHAR(128), nullable=False)
small_groups = relationship("SmallGroup", back_populates="course")
......
......@@ -44,6 +44,8 @@ class CourseWithoutAppointments(BaseModel):
cid: str
name: str
description: Optional[str]
ou: str
instructors: str
class Config:
orm_mode = True
......
......@@ -111,9 +111,14 @@ async def parse_courses(links: List[str]) -> List[schemas.Course]:
title = soup.find('form', attrs={'name': 'courseform'}).find('h1').text.strip()
split_title = title.splitlines()
instructors_entry = soup.find('span', attrs={'id': 'dozenten'}).text.strip()
ou_entry = soup.find('span', attrs={'name': 'courseOrgUnit'}).text.strip()
parsed_courses.append(schemas.Course(
cid=split_title[0],
name=split_title[1],
instructors=instructors_entry,
ou=ou_entry,
appointments=__parse_appointment(soup),
small_groups=await __parse_small_groups(soup)
))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment