14 lines
514 B
Python
14 lines
514 B
Python
import sqlite3, json
|
|
conn = sqlite3.connect('cms.db')
|
|
c = conn.cursor()
|
|
c.execute("SELECT content FROM home_modules WHERE type='features'")
|
|
row = c.fetchone()
|
|
if row:
|
|
content = json.loads(row[0])
|
|
for i, item in enumerate(content.get('items', [])):
|
|
print(f'[{i}] id={item.get("id")} title={item.get("title")}')
|
|
print(f' media_url={item.get("media_url")}')
|
|
print(f' image={item.get("image")}')
|
|
print(f' media_type={item.get("media_type")}')
|
|
conn.close()
|