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

Backend - Add/Delete Mentors-Admin-App - Self-Sprint-3 #128

Open
askinss opened this issue May 7, 2023 · 1 comment
Open

Backend - Add/Delete Mentors-Admin-App - Self-Sprint-3 #128

askinss opened this issue May 7, 2023 · 1 comment
Assignees

Comments

@askinss
Copy link
Collaborator

askinss commented May 7, 2023

Add the API endpoints but verify if it is nothing existing already.
Add Mentors Admin
Delete Mentor Admin

check corresponding Frontend
https://github.com/orgs/ALCOpenSource/projects/16/views/1?pane=issue&itemId=24567008

@Albert-Byrone
Copy link
Collaborator

@askinss What do you think about this

class User(Base):
    __tablename__ = "users"
    id = Column(Integer, primary_key=True)
    name = Column(String)
    email = Column(String, unique=True)
    password = Column(String)
    role_id = Column(Integer, ForeignKey("roles.id"))
    role = relationship("Role", back_populates="users")

class Role(Base):
    __tablename__ = "roles"
    id = Column(Integer, primary_key=True)
    name = Column(Enum("user", "mentor", "mentor_manager", name="role_types"))
    users = relationship("User", back_populates="role")

    def __repr__(self):
        return f"<Role(name={self.name})>"

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

No branches or pull requests

2 participants