Added the database
This commit is contained in:
Binary file not shown.
+6
-4
@@ -1,7 +1,9 @@
|
||||
from tiny0 import db
|
||||
|
||||
'''
|
||||
class URL(db.Model):
|
||||
id = db.Column(db.Integer, primary_key=True)
|
||||
token = db.Column(db.String(8), index=True, unique=True, nullable=False)
|
||||
url = db.Column(db.String(2000), nullable=False)
|
||||
|
||||
Declaration of models
|
||||
|
||||
'''
|
||||
def __repr__(self):
|
||||
return f"'{self.id}' '{self.token}' '{self.url}'"
|
||||
|
||||
+2
-2
@@ -1,7 +1,7 @@
|
||||
from flask import render_template, redirect, request, url_for
|
||||
from tiny0 import app
|
||||
from tiny0 import app, db
|
||||
from tiny0.forms import URLForm
|
||||
#from tiny0.models import URLs
|
||||
from tiny0.models import URL
|
||||
#from token import gen_valid_token
|
||||
|
||||
# Index Page
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
#from tiny0.models import URLs
|
||||
#from tiny0.models import URL
|
||||
from secrets import choice
|
||||
|
||||
'''
|
||||
|
||||
Reference in New Issue
Block a user