Initial commit — PlantGuideScraper project
This commit is contained in:
24
backend/app/models/export.py
Normal file
24
backend/app/models/export.py
Normal file
@@ -0,0 +1,24 @@
|
||||
from sqlalchemy import Column, Integer, String, Float, DateTime, Text, func
|
||||
|
||||
from app.database import Base
|
||||
|
||||
|
||||
class Export(Base):
|
||||
__tablename__ = "exports"
|
||||
|
||||
id = Column(Integer, primary_key=True, index=True)
|
||||
name = Column(String, nullable=False)
|
||||
filter_criteria = Column(Text, nullable=True) # JSON: min_images, licenses, min_quality, species_ids
|
||||
train_split = Column(Float, default=0.8)
|
||||
status = Column(String, default="pending") # pending, generating, completed, failed
|
||||
file_path = Column(String, nullable=True)
|
||||
file_size = Column(Integer, nullable=True)
|
||||
species_count = Column(Integer, nullable=True)
|
||||
image_count = Column(Integer, nullable=True)
|
||||
celery_task_id = Column(String, nullable=True)
|
||||
created_at = Column(DateTime, server_default=func.now())
|
||||
completed_at = Column(DateTime, nullable=True)
|
||||
error_message = Column(Text, nullable=True)
|
||||
|
||||
def __repr__(self):
|
||||
return f"<Export(id={self.id}, name='{self.name}', status='{self.status}')>"
|
||||
Reference in New Issue
Block a user