Skip to content
Snippets Groups Projects
Verified Commit 11da03aa authored by Vasanth Viswanath S's avatar Vasanth Viswanath S Committed by Sachin Kamath
Browse files

Add challenge model

parent 1da07eb8
No related branches found
No related tags found
No related merge requests found
# -*- coding: utf-8 -*-
from hodor import db
from sqlalchemy import inspect
class Challenges(db.Model):
__tablename__= 'challenges'
#Data variables for each Challenges
chalid=db.Column(db.String(32), primary_key=True,unique=True,nullable=False)
name = db.Column(db.String(32), nullable=False)
points = db.Column(db.Integer, nullable=False)
description = db.Column(db.String(2048), nullable=False)
@staticmethod
def save(self):
db.session.add(self)
db.session.commit()
def delete(self):
db.session.delete(self)
db.session.commit()
def get_all():
return Challenges.query.all()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment