initial commit blyad
This commit is contained in:
17
models.py
Normal file
17
models.py
Normal 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))
|
||||
Reference in New Issue
Block a user