Skip to content
Permalink
4ac46c7745
Switch branches/tags
Go to file
 
 
Cannot retrieve contributors at this time
from flask import Flask, render_template, redirect, url_for
from flask_sqlalchemy import SQLAlchemy
from flask_migrate import Migrate, MigrateCommand
from flask_script import Manager
from flask_uploads import UploadSet, configure_uploads, IMAGES
from flask_wtf import FlaskForm
from wtforms import StringField ,TextAreaField,IntegerField
from flask_wtf.file import FileField,FileAllowed
from datetime import date
app = Flask(__name__)
app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///books.db'
app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False
app.config['DEBUG'] = True
app.config['SECRET_KEY'] = 'qhbdhbqedejkwbxdjcewjdjb'
db = SQLAlchemy(app)
class Books(db.Model):
bookname=db.Column(db.Integer)
author=db.Column(db.String(50),default="UNKNOWN")
publishdate=db.Column(db.date,default="UNKNOWN")
ISB13=db.Column(db.Integer,primary_key=True)
description=db.Column(db.String(500),)
tradeprice=db.Column(db.Integer,nullable=False)
retailprice=db.Column(db.Integer,nullable=False)
stocks=db.Colomn(db.Integer)
image=db.Column(db.String(500))