Skip to content
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

Closed
mathiasbrito-dci opened this issue Jun 24, 2022 · 16 comments

Comments

@mathiasbrito-dci
Copy link
Contributor

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

@Hans-Lambda
Copy link
Contributor

I will do it tomorrow :D

@elinamat
Copy link

What do you mean by that Mathias? the Classes? E.g the 1)Post() 2)User() 3)Course() Objects.

@mathiasbrito-dci
Copy link
Contributor Author

mathiasbrito-dci commented Jun 24, 2022 via email

@mathiasbrito-dci
Copy link
Contributor Author

@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.

@Hans-Lambda
Copy link
Contributor

okay, we will do so. Expect it tomorrow around 17.00 : )

@petertheprofessional
Copy link
Contributor

petertheprofessional commented Jun 24, 2022

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

@petertheprofessional
Copy link
Contributor

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)

@mathiasbrito-dci
Copy link
Contributor Author

A student probably has an institution associated, right? A teacher has classes... a Researcher usually belongs to a lab and also a department...

@Hans-Lambda
Copy link
Contributor

Hans-Lambda commented Jun 25, 2022

pull req (#22) for models online

@elinamat
Copy link

I was thinking just one class User() and then separate them as Student(User), Teacher(User) and Institution(User) ...!

class User(BaseModel):
id: str
username: str
password: str
email: str
registration_date: str
is_active: bool
name: str
address: str
phone_number: str

What about Course() and Post()?!!

@mathiasbrito-dci
Copy link
Contributor Author

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.

@mathiasbrito-dci
Copy link
Contributor Author

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.

@mathiasbrito-dci mathiasbrito-dci changed the title Models for users/students/teachers needs to be defined Models for users/students/teachers and Institution needs to be defined Jun 27, 2022
@hilabit
Copy link

hilabit commented Jun 27, 2022

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 = []

@elinamat
Copy link

elinamat commented Jun 27, 2022

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

@mathiasbrito-dci
Copy link
Contributor Author

Closed by #23

@lamalul
Copy link

lamalul commented Jul 4, 2022

@mathiasbrito-dci For Issue #19 we need a "role" attribute in the class User .This is hindering us from implementation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment