first commit
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
import json
|
||||
|
||||
import db
|
||||
|
||||
|
||||
def get_element(slug, element_id):
|
||||
conn = db.connect(slug)
|
||||
row = conn.execute("SELECT * FROM _screen_elements WHERE id = ?", (element_id,)).fetchone()
|
||||
conn.close()
|
||||
if not row:
|
||||
return None
|
||||
d = dict(row)
|
||||
d["style"] = json.loads(d["style"] or "{}")
|
||||
d["attributes"] = json.loads(d["attributes"] or "{}")
|
||||
return d
|
||||
Reference in New Issue
Block a user