tons of fun
This commit is contained in:
@ -1,12 +1,17 @@
|
||||
from app import db
|
||||
#from plugins.plant.models import Plant
|
||||
|
||||
plant_tags = db.Table(
|
||||
'plant_tags',
|
||||
db.Column('plant_id', db.Integer, db.ForeignKey('plants.id'), primary_key=True),
|
||||
db.Column('tag_id', db.Integer, db.ForeignKey('tags.id'), primary_key=True)
|
||||
)
|
||||
# plant_tags = db.Table(
|
||||
# 'plant_tags',
|
||||
# db.metadata,
|
||||
# db.Column('plant_id', db.Integer, db.ForeignKey('plant.id'), primary_key=True),
|
||||
# db.Column('tag_id', db.Integer, db.ForeignKey('tags.id'), primary_key=True),
|
||||
# extend_existing=True
|
||||
# )
|
||||
|
||||
class Tag(db.Model):
|
||||
__tablename__ = 'tags'
|
||||
id = db.Column(db.Integer, primary_key=True)
|
||||
name = db.Column(db.String(100), unique=True, nullable=False)
|
||||
# class Tag(db.Model):
|
||||
# __tablename__ = 'tags'
|
||||
# __table_args__ = {'extend_existing': True}
|
||||
|
||||
# id = db.Column(db.Integer, primary_key=True)
|
||||
# name = db.Column(db.String(100), unique=True, nullable=False)
|
||||
|
@ -1,9 +1,8 @@
|
||||
from flask import Blueprint, render_template, request, jsonify
|
||||
from flask_login import login_required, current_user
|
||||
from app import db
|
||||
from .models import Tag
|
||||
from .forms import SearchForm
|
||||
from plugins.plant.models import Plant
|
||||
from plugins.plant.models import Plant, Tag
|
||||
|
||||
bp = Blueprint('search', __name__, template_folder='templates')
|
||||
|
||||
|
Reference in New Issue
Block a user