valar 1.0.17__py3-none-any.whl → 1.0.18__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of valar might be problematic. Click here for more details.
- valar/channels/__init__.py +7 -3
- valar/channels/views.py +3 -2
- valar/data/migrations/0001_initial.py +517 -145
- valar/data/migrations/0002_valatree_alter_metafield_allow_sort.py +36 -0
- valar/data/models.py +11 -7
- valar/data/mon/__init__.py +44 -5
- valar/data/mon/query_translator.py +91 -0
- valar/data/orm/__init__.py +25 -2
- valar/data/orm/meta.py +28 -6
- valar/data/orm/meta_loader.py +19 -5
- valar/data/query.py +14 -14
- valar/data/urls.py +15 -9
- valar/data/views.py +56 -8
- {valar-1.0.17.dist-info → valar-1.0.18.dist-info}/METADATA +1 -1
- valar-1.0.18.dist-info/RECORD +26 -0
- {valar-1.0.17.dist-info → valar-1.0.18.dist-info}/WHEEL +1 -1
- valar-1.0.17.dist-info/RECORD +0 -24
- {valar-1.0.17.dist-info → valar-1.0.18.dist-info}/licenses/LICENSE +0 -0
- {valar-1.0.17.dist-info → valar-1.0.18.dist-info}/top_level.txt +0 -0
valar/channels/__init__.py
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import json
|
|
1
2
|
from datetime import datetime
|
|
2
3
|
|
|
3
4
|
from asgiref.sync import async_to_sync
|
|
@@ -13,7 +14,8 @@ except AttributeError:
|
|
|
13
14
|
GROUP = 'VALAR'
|
|
14
15
|
|
|
15
16
|
class ValarSocketSender:
|
|
16
|
-
def __init__(self,
|
|
17
|
+
def __init__(self, request: HttpRequest):
|
|
18
|
+
body = json.loads(request.body)
|
|
17
19
|
client = request.headers.get('CLIENT')
|
|
18
20
|
auth = request.headers.get('AUTH')
|
|
19
21
|
uid = request.session.get('UID')
|
|
@@ -21,7 +23,8 @@ class ValarSocketSender:
|
|
|
21
23
|
raise Exception('Unauthorized!')
|
|
22
24
|
self.client = client
|
|
23
25
|
self.uid = uid
|
|
24
|
-
self.
|
|
26
|
+
self.handlerKey = body.get('handlerKey')
|
|
27
|
+
self.channelKey = body.get('channelKey', 'default')
|
|
25
28
|
self.send = get_channel_layer().group_send
|
|
26
29
|
|
|
27
30
|
|
|
@@ -31,7 +34,8 @@ class ValarSocketSender:
|
|
|
31
34
|
'type': emit,
|
|
32
35
|
'data': {
|
|
33
36
|
'status': status,
|
|
34
|
-
'
|
|
37
|
+
'handlerKey': self.handlerKey,
|
|
38
|
+
'channelKey': self.channelKey,
|
|
35
39
|
'payload': data,
|
|
36
40
|
'timestamp': datetime.now().timestamp()
|
|
37
41
|
},
|
valar/channels/views.py
CHANGED
|
@@ -7,8 +7,9 @@ from ..channels import ValarSocketSender
|
|
|
7
7
|
|
|
8
8
|
async def handel_channel(request, handler):
|
|
9
9
|
method = get_channel_handler(handler)
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
body = json.loads(request.body)
|
|
11
|
+
data = body.get('data')
|
|
12
|
+
sender = ValarSocketSender(request)
|
|
12
13
|
await execute_channel(method, data, sender)
|
|
13
14
|
return ValarResponse(True)
|
|
14
15
|
|