Files
Hotel-Booking/Backend/seed_about_page.py
Iliyan Angelov 6f85b8cf17 updates
2025-11-21 01:20:51 +02:00

203 lines
8.8 KiB
Python

#!/usr/bin/env python3
import sys
import os
from pathlib import Path
import json
sys.path.insert(0, str(Path(__file__).parent))
from sqlalchemy.orm import Session
from src.config.database import SessionLocal
from src.models.page_content import PageContent, PageType
from datetime import datetime
def get_db():
db = SessionLocal()
try:
return db
finally:
pass
def seed_about_page(db: Session):
print("=" * 80)
print("SEEDING ABOUT PAGE CONTENT")
print("=" * 80)
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":
,
"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",
"values": json.dumps([
{
"icon": "Heart",
"title": "Passion",
"description": "We are passionate about hospitality and dedicated to creating exceptional experiences for every guest."
},
{
"icon": "Award",
"title": "Excellence",
"description": "We strive for excellence in every aspect of our service, from the smallest detail to the grandest gesture."
},
{
"icon": "Shield",
"title": "Integrity",
"description": "We conduct our business with honesty, transparency, and respect for our guests and community."
},
{
"icon": "Users",
"title": "Service",
"description": "Our guests are at the heart of everything we do. Your comfort and satisfaction are our top priorities."
}
]),
"features": json.dumps([
{
"icon": "Star",
"title": "Premium Accommodations",
"description": "Luxuriously appointed rooms and suites designed for ultimate comfort and relaxation."
},
{
"icon": "Clock",
"title": "24/7 Service",
"description": "Round-the-clock concierge and room service to attend to your needs at any time."
},
{
"icon": "Award",
"title": "Award-Winning",
"description": "Recognized for excellence in hospitality and guest satisfaction."
}
]),
"team": json.dumps([
{
"name": "Sarah Johnson",
"role": "General Manager",
"image": "https://images.unsplash.com/photo-1494790108377-be9c29b29330?w=400&h=400&fit=crop",
"bio": "With over 15 years of experience in luxury hospitality, Sarah leads our team with passion and dedication.",
"social_links": {
"linkedin": "https://linkedin.com/in/sarahjohnson",
"twitter": "https://twitter.com/sarahjohnson"
}
},
{
"name": "Michael Chen",
"role": "Head Chef",
"image": "https://images.unsplash.com/photo-1507003211169-0a1dd7228f2d?w=400&h=400&fit=crop",
"bio": "Award-winning chef with expertise in international cuisine, bringing world-class dining experiences to our guests.",
"social_links": {
"linkedin": "https://linkedin.com/in/michaelchen",
"twitter": "https://twitter.com/michaelchen"
}
},
{
"name": "Emily Rodriguez",
"role": "Guest Relations Manager",
"image": "https://images.unsplash.com/photo-1438761681033-6461ffad8d80?w=400&h=400&fit=crop",
"bio": "Ensuring every guest feels valued and receives personalized attention throughout their stay.",
"social_links": {
"linkedin": "https://linkedin.com/in/emilyrodriguez"
}
}
]),
"timeline": json.dumps([
{
"year": "2010",
"title": "Grand Opening",
"description": "Luxury Hotel opened its doors, welcoming guests to a new standard of luxury hospitality.",
"image": "https://images.unsplash.com/photo-1566073771259-6a8506099945?w=800&h=600&fit=crop"
},
{
"year": "2015",
"title": "First Award",
"description": "Received our first 'Best Luxury Hotel' award, recognizing our commitment to excellence.",
"image": "https://images.unsplash.com/photo-1571896349842-33c89424de2d?w=800&h=600&fit=crop"
},
{
"year": "2018",
"title": "Major Renovation",
"description": "Completed a comprehensive renovation, adding state-of-the-art facilities and expanding our capacity.",
"image": "https://images.unsplash.com/photo-1590490360182-c33d57733427?w=800&h=600&fit=crop"
},
{
"year": "2020",
"title": "Sustainability Initiative",
"description": "Launched our sustainability program, committing to eco-friendly practices and community engagement.",
"image": "https://images.unsplash.com/photo-1611892440504-42a792e24d32?w=800&h=600&fit=crop"
},
{
"year": "2023",
"title": "International Recognition",
"description": "Achieved international recognition as one of the world's top luxury hotels.",
"image": "https://images.unsplash.com/photo-1564501049412-61c2a3083791?w=800&h=600&fit=crop"
}
]),
"achievements": json.dumps([
{
"icon": "Award",
"title": "Best Luxury Hotel 2023",
"description": "Recognized as the best luxury hotel in the region for exceptional service and amenities.",
"year": "2023",
"image": "https://images.unsplash.com/photo-1571896349842-33c89424de2d?w=400&h=300&fit=crop"
},
{
"icon": "Star",
"title": "5-Star Rating",
"description": "Maintained our prestigious 5-star rating for over a decade, a testament to our consistent excellence.",
"year": "2022",
"image": "https://images.unsplash.com/photo-1566073771259-6a8506099945?w=400&h=300&fit=crop"
},
{
"icon": "Award",
"title": "Sustainable Hotel of the Year",
"description": "Awarded for our commitment to environmental sustainability and green practices.",
"year": "2021",
"image": "https://images.unsplash.com/photo-1611892440504-42a792e24d32?w=400&h=300&fit=crop"
},
{
"icon": "Users",
"title": "Guest Satisfaction Excellence",
"description": "Achieved 98% guest satisfaction rate, the highest in our category.",
"year": "2023",
"image": "https://images.unsplash.com/photo-1590490360182-c33d57733427?w=400&h=300&fit=crop"
}
]),
"meta_title": "About Us - Luxury Hotel | Our Story, Mission & Vision",
"meta_description": "Learn about Luxury Hotel's commitment to excellence, our story, values, and the dedicated team that makes every stay unforgettable."
}
existing = db.query(PageContent).filter(PageContent.page_type == PageType.ABOUT).first()
if existing:
for key, value in about_data.items():
setattr(existing, key, value)
existing.updated_at = datetime.utcnow()
print("✓ Updated existing about page content")
else:
new_content = PageContent(
page_type=PageType.ABOUT,
**about_data
)
db.add(new_content)
print("✓ Created new about page content")
db.commit()
print("\n✅ About page content seeded successfully!")
print("=" * 80)
if __name__ == "__main__":
db = get_db()
try:
seed_about_page(db)
except Exception as e:
print(f"\n❌ Error: {e}")
import traceback
traceback.print_exc()
db.rollback()
finally:
db.close()