[text] task managment task

Viewer

copydownloadembedprintName: task managment task
  1. from flask_sqlalchemy import SQLAlchemy
  2. from flask import Flask
  3.  
  4. app = Flask(__name__)
  5.  
  6. app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///management.db'
  7. db = SQLAlchemy(app)
  8.  
  9. class Task(db.Model):
  10.     id = db.Column(db.Integer, primary_key=True)
  11.     title = db.Column(db.String(100), nullable=False)
  12.     complete = db.Column(db.Boolean, default=False)
  13.  
  14.     def __repr__(self):
  15.         return f'<Task {self.id}: {self.title}, Complete: {self.complete}>'

Editor

You can edit this paste and save as new:


File Description
  • task managment task
  • Paste Code
  • 17 Apr-2024
  • 467 Bytes
You can Share it: