-
Notifications
You must be signed in to change notification settings - Fork 4
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
Models for users/students/teachers and Institution needs to be defined #21
Comments
I will do it tomorrow :D |
What do you mean by that Mathias? the Classes? E.g the 1)Post() 2)User() 3)Course() Objects. |
Yes. They represent the data that is coming from the database.
… Em 24.06.2022, à(s) 12:38, elinamat ***@***.***> escreveu:
What do you mean by that Mathias? the Classes? E.g the 1)Post() 2)User() 3)Course() Objects.
—
Reply to this email directly, view it on GitHub <#21 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AYHQMU5UIB75REC2NZVYGVDVQWF2LANCNFSM5ZXGASAQ>.
You are receiving this because you authored the thread.
|
@Hans-Lambda, then create a branch called issue_21_models when you're done push it to remote... so we can review and agree on the model you created. |
okay, we will do so. Expect it tomorrow around 17.00 : ) |
from pydantic import BaseModel
class User(BaseModel):
username: str
password: str
creation_date: int # Date User was created in system
active: bool
class Person(User):
first_name: str
last_name: str
id_number: int
gender: str
email: str
phone_number: str
address: str
class Student(Person):
current_courses: list
previous_courses: list
class ProspectiveStudent(Person):
pass
class Teacher(Person):
pass
class Mentor(Person):
pass
class Researcher(Person):
pass
class Organization(User):
active_emails: list
contact_numbers: list
class ResearchInstitution(Organization):
pass
class EducationalInstitution(Organization):
pass |
I just posted a few possible models to this feed, feel free to start a discussion about what we want to add. (not even sure I'm suggesting the correct information) |
A student probably has an institution associated, right? A teacher has classes... a Researcher usually belongs to a lab and also a department... |
pull req (#22) for models online |
I was thinking just one class User() and then separate them as Student(User), Teacher(User) and Institution(User) ...! class User(BaseModel): What about Course() and Post()?!! |
Yes, Elina, you are in the right direction, we need to keep the focus... the stories only handle "Studen", "Teacher" and "Institution"... I would suggest incorporating Elina's suggestions into the User model. Please check the #22, the pull request from Billy and Franz, I think we need to discuss it, and try to avoid distractions focus on the relevant models. |
I think it will be necessary to create the Institution model - based on the stories selected for this sprint. I'll update the title of this issue then. Other models can appear, but since these are crucial, I'll keep only them in the issue's title. |
from pydantic import BaseModel
class User(BaseModel):
id: str
username: str
password: str
creation_date: int # Date User was created in system
first_name: str
last_name: str
gender: str
email: str
phone_number: str
address: str
is_loggedin: boolean
role: str
posts: []
assigned_institution: []
current_courses: []
previous_courses: []
class Student(User):
fields_of_study: []
tasks: []
class Teacher(User):
years_of_experience: int
qualification: str
class Mentor(User):
pass
class Researcher(User):
pass
class Course(BaseModel):
starting_date: int
end_date: int
starting_time: int
end_time: int
credit_points: int
teacher: Teacher
students: List[Student]
class Organization(BaseModel):
id: str
name: str
email: str
address: str
url: str
posts: []
courses: List[Course]
available_positions = []
class EducationalInstitution(Organization):
courses = []
# class HiringCompanies(Organization):
# available_positions = []
# internships = [] |
from datetime import datetime
from pydantic import BaseModel
class User(BaseModel):
id: str
username: str
password: str
email: str
created_on: datetime
is_active: bool # is User online?
prospective: bool
name: str
address: str
website: str
connections: [] # "Friends" connections with others
about: Optional[str]
class Person(User):
date_of_birth: datetime
gender: str
phone_number: str
class Student(Person):
current_courses: []
completed_courses: []
institution: Institution
interests: List[str]
class Teacher(Person):
courses_in_progress: []
old_courses: []
future_courses: []
institution: Institution
interests: List[str]
class Institution(User):
phone_numbers: []
associates: []
head_of_organization: str
research_institution: bool
education_institution: bool
research_projects: []
active_courses: []
inactive_courses: []
offers: []
class Post(BaseModel):
title: str
body: []
creator: User
creation_date: datetime
comments_on_this_post: []
likes_for_this_post: []
shares_for_this_post: []
type_of_post: str
class Course(BaseModel):
title: str
starting_date: datetime
end_date: datetime
starting_time: datetime
end_time: datetime
credit_points: int
teacher: Teacher |
Closed by #23 |
@mathiasbrito-dci For Issue #19 we need a "role" attribute in the class User .This is hindering us from implementation |
In order to implement the stories selected in the first sprint we need to define the models. I would suggest using this thread to do so, could anyone suggest a first draft. This task is urgent since it will block the development of some stories in the current sprint. I can only assign 10 people to and issue but all of you needs to participate.
@dci-python-backend-assignments/dci-python-class-2022
The text was updated successfully, but these errors were encountered: