support documents
This commit is contained in:
parent
e8e13562cc
commit
64f60f319a
1 changed files with 12 additions and 1 deletions
|
@ -166,7 +166,18 @@ class Item(models.Model):
|
|||
hue = None
|
||||
parts = self.url.split('/')
|
||||
url = '/'.join(parts[:3]) + '/api/'
|
||||
if parts[4] == 'edits':
|
||||
if parts[4] == 'documents':
|
||||
document_id = parts[5]
|
||||
request = {
|
||||
"action": "getDocument",
|
||||
"data": {
|
||||
"id": document_id,
|
||||
"keys": []
|
||||
}
|
||||
}
|
||||
response = requests.post(url, json=request).json()
|
||||
return response["data"].get("hue")
|
||||
elif parts[4] == 'edits':
|
||||
edit = urllib.parse.unquote(parts[5]).replace('_', ' ')
|
||||
request = {
|
||||
"action": "getEdit",
|
||||
|
|
Loading…
Add table
Reference in a new issue