1. Dynamic metadata retrieval, refactored function 2. Load with using marshmallow, allows dynamic fields now 3. Added chunkers, different varieties 4. Fixed PDF loading so it is better standardized
23 lines
891 B
Python
23 lines
891 B
Python
# test_set.py
|
|
from datetime import datetime
|
|
from sqlalchemy import Column, Integer, String, DateTime, ForeignKey
|
|
from sqlalchemy.orm import relationship
|
|
import os
|
|
import sys
|
|
sys.path.append(os.path.dirname(os.path.abspath(__file__)))
|
|
from database.database import Base
|
|
|
|
|
|
class TestSet(Base):
|
|
__tablename__ = 'test_sets'
|
|
|
|
id = Column(String, primary_key=True)
|
|
user_id = Column(String, ForeignKey('users.id'), index=True)
|
|
created_at = Column(DateTime, default=datetime.utcnow)
|
|
updated_at = Column(DateTime, default=datetime.utcnow, onupdate=datetime.utcnow)
|
|
|
|
user = relationship("User", back_populates="test_sets")
|
|
test_outputs = relationship("TestOutput", back_populates="test_set", cascade="all, delete-orphan")
|
|
|
|
def __repr__(self):
|
|
return f"<TestSet(id={self.id}, user_id={self.user_id}, created_at={self.created_at}, updated_at={self.updated_at})>"
|