updates
This commit is contained in:
@@ -1,14 +1,10 @@
|
||||
#!/usr/bin/env python3
|
||||
"""
|
||||
Seed sample data for the About page
|
||||
"""
|
||||
|
||||
import sys
|
||||
import os
|
||||
from pathlib import Path
|
||||
import json
|
||||
|
||||
# Add the parent directory to the path so we can import from src
|
||||
sys.path.insert(0, str(Path(__file__).parent))
|
||||
|
||||
from sqlalchemy.orm import Session
|
||||
@@ -17,7 +13,6 @@ from src.models.page_content import PageContent, PageType
|
||||
from datetime import datetime
|
||||
|
||||
def get_db():
|
||||
"""Get database session"""
|
||||
db = SessionLocal()
|
||||
try:
|
||||
return db
|
||||
@@ -25,23 +20,16 @@ def get_db():
|
||||
pass
|
||||
|
||||
def seed_about_page(db: Session):
|
||||
"""Seed about page content"""
|
||||
print("=" * 80)
|
||||
print("SEEDING ABOUT PAGE CONTENT")
|
||||
print("=" * 80)
|
||||
|
||||
# Sample data
|
||||
about_data = {
|
||||
"title": "About Luxury Hotel",
|
||||
"subtitle": "Where Excellence Meets Unforgettable Experiences",
|
||||
"description": "Discover the story behind our commitment to luxury hospitality and exceptional service.",
|
||||
"story_content": """Welcome to Luxury Hotel, where timeless elegance meets modern sophistication. Since our founding in 2010, we have been dedicated to providing exceptional hospitality and creating unforgettable memories for our guests.
|
||||
|
||||
Nestled in the heart of the city, our hotel combines classic architecture with contemporary amenities, offering a perfect blend of comfort and luxury. Every detail has been carefully curated to ensure your stay exceeds expectations.
|
||||
|
||||
Our commitment to excellence extends beyond our beautiful rooms and facilities. We believe in creating meaningful connections with our guests, understanding their needs, and delivering personalized service that makes each visit special.
|
||||
|
||||
Over the years, we have hosted thousands of guests from around the world, each leaving with cherished memories and a desire to return. Our team of dedicated professionals works tirelessly to ensure that every moment of your stay is perfect.""",
|
||||
"story_content":
|
||||
,
|
||||
"mission": "To provide unparalleled luxury hospitality experiences that exceed expectations, creating lasting memories for our guests through exceptional service, attention to detail, and genuine care.",
|
||||
"vision": "To be recognized as the world's premier luxury hotel brand, setting the standard for excellence in hospitality while maintaining our commitment to sustainability and community engagement.",
|
||||
"about_hero_image": "https://images.unsplash.com/photo-1566073771259-6a8506099945?w=1920&h=1080&fit=crop",
|
||||
@@ -181,17 +169,14 @@ Over the years, we have hosted thousands of guests from around the world, each l
|
||||
"meta_description": "Learn about Luxury Hotel's commitment to excellence, our story, values, and the dedicated team that makes every stay unforgettable."
|
||||
}
|
||||
|
||||
# Check if about page content exists
|
||||
existing = db.query(PageContent).filter(PageContent.page_type == PageType.ABOUT).first()
|
||||
|
||||
if existing:
|
||||
# Update existing
|
||||
for key, value in about_data.items():
|
||||
setattr(existing, key, value)
|
||||
existing.updated_at = datetime.utcnow()
|
||||
print("✓ Updated existing about page content")
|
||||
else:
|
||||
# Create new
|
||||
new_content = PageContent(
|
||||
page_type=PageType.ABOUT,
|
||||
**about_data
|
||||
|
||||
Reference in New Issue
Block a user