| 12345678910111213141516171819202122232425262728293031 |
- import json
- from app import create_app, db
- from app.models import PageContent
- app = create_app()
- with app.app_context():
- solution_data = [
- {
- "title": "产教融合",
- "items": ["产业学院", "数智工坊", "高校实验室(训战)", "AI人才认证"]
- },
- {
- "title": "产业服务",
- "items": ["AI+政务服务解决方案", "智慧安防", "AI+医疗诊断解决方案"]
- }
- ]
-
- existing = PageContent.query.filter_by(page_key='solutions').first()
- if existing:
- existing.content = json.dumps(solution_data, ensure_ascii=False)
- else:
- new_page = PageContent(
- page_key='solutions',
- page_name='解决方案',
- content=json.dumps(solution_data, ensure_ascii=False)
- )
- db.session.add(new_page)
-
- db.session.commit()
- print("Solutions page data seeded successfully.")
|