initial commit blyad

This commit is contained in:
2025-08-11 21:49:33 +02:00
commit d342f888a9
14 changed files with 738 additions and 0 deletions

17
models.py Normal file
View File

@@ -0,0 +1,17 @@
from flask_sqlalchemy import SQLAlchemy
db = SQLAlchemy()
class Problem(db.Model):
id = db.Column(db.Integer, primary_key=True)
title = db.Column(db.String(100), nullable=False)
description = db.Column(db.Text, nullable=False)
test_code = db.Column(db.Text, nullable=False) # Python code to test solution
class Solution(db.Model):
id = db.Column(db.Integer, primary_key=True)
problem_id = db.Column(db.Integer, db.ForeignKey('problem.id'), nullable=False)
user_code = db.Column(db.Text, nullable=False)
passed = db.Column(db.Boolean, default=False)
output = db.Column(db.Text)
problem = db.relationship('Problem', backref=db.backref('solutions', lazy=True))