revised testing critera
This commit is contained in:
31
models.py
31
models.py
@@ -2,17 +2,30 @@ from flask_sqlalchemy import SQLAlchemy
|
||||
|
||||
db = SQLAlchemy()
|
||||
|
||||
|
||||
class Feature(db.Model):
|
||||
id = db.Column(db.Integer, primary_key=True)
|
||||
title = db.Column(db.String(100), nullable=False)
|
||||
description = db.Column(db.String(200), nullable=False)
|
||||
|
||||
def seed_db():
|
||||
if Feature.query.count() == 0: # Seed only if empty
|
||||
features = [
|
||||
Feature(title="Responsive Design", description="Adapts seamlessly to mobile, tablet, and desktop devices."),
|
||||
Feature(title="Modern UI", description="Uses Bootstrap 5 for clean, professional styling."),
|
||||
Feature(title="Easy Deployment", description="Containerized with Docker for quick setup on any server.")
|
||||
]
|
||||
db.session.bulk_save_objects(features)
|
||||
db.session.commit()
|
||||
@staticmethod
|
||||
def seed_db():
|
||||
# Seed only if empty
|
||||
if Feature.query.count() == 0:
|
||||
features = [
|
||||
Feature(
|
||||
title="Responsive Design",
|
||||
description="Adapts seamlessly to mobile, tablet, and desktop devices.",
|
||||
),
|
||||
Feature(
|
||||
title="Modern UI",
|
||||
description="Uses Bootstrap 5 for clean, professional styling.",
|
||||
),
|
||||
Feature(
|
||||
title="Easy Deployment",
|
||||
description="Containerized with Docker for quick setup on any server.",
|
||||
),
|
||||
]
|
||||
db.session.bulk_save_objects(features)
|
||||
db.session.commit()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user