Files
Portfolio/apps/backend/app/models/project.py
T

76 lines
1.2 KiB
Python

from sqlalchemy import (
Column,
Integer,
String,
Text,
Boolean
)
from sqlalchemy.orm import relationship
from app.database import Base
from app.models.project_skill import project_skills
class Project(Base):
__tablename__ = "projects"
id = Column(
Integer,
primary_key=True,
index=True,
nullable=False
)
title = Column(
String(255),
nullable=False
)
nb_image = Column(
Integer,
default=1,
nullable=True
)
short_description = Column(
Text,
nullable=False
)
image_name = Column(
String(255),
nullable=False,
default="empty"
)
school = Column(
Boolean,
nullable=False
)
long_description = Column(
Text,
nullable=False
)
repo_link = Column(
String(255),
nullable=True
)
beginning_year = Column(
Integer,
nullable=False
)
end_year = Column(
Integer,
nullable=True
)
skills = relationship(
"Skill",
secondary=project_skills,
back_populates="projects"
)