simo 2.0.17__py3-none-any.whl → 2.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 simo might be problematic. Click here for more details.
- simo/core/__pycache__/serializers.cpython-38.pyc +0 -0
- simo/core/serializers.py +4 -2
- simo/fleet/__pycache__/serializers.cpython-38.pyc +0 -0
- simo/fleet/serializers.py +18 -3
- {simo-2.0.17.dist-info → simo-2.0.18.dist-info}/METADATA +1 -1
- {simo-2.0.17.dist-info → simo-2.0.18.dist-info}/RECORD +9 -9
- {simo-2.0.17.dist-info → simo-2.0.18.dist-info}/LICENSE.md +0 -0
- {simo-2.0.17.dist-info → simo-2.0.18.dist-info}/WHEEL +0 -0
- {simo-2.0.17.dist-info → simo-2.0.18.dist-info}/top_level.txt +0 -0
|
Binary file
|
simo/core/serializers.py
CHANGED
|
@@ -4,6 +4,7 @@ import json
|
|
|
4
4
|
from django import forms
|
|
5
5
|
from collections import OrderedDict
|
|
6
6
|
from django.forms.utils import ErrorDict
|
|
7
|
+
from django.conf import settings
|
|
7
8
|
from collections.abc import Iterable
|
|
8
9
|
from easy_thumbnails.files import get_thumbnailer
|
|
9
10
|
from simo.core.middleware import get_current_request
|
|
@@ -52,9 +53,10 @@ class CategorySerializer(serializers.ModelSerializer):
|
|
|
52
53
|
def get_header_image_thumb(self, obj):
|
|
53
54
|
if obj.header_image:
|
|
54
55
|
thumbnailer = get_thumbnailer(obj.header_image.path)
|
|
55
|
-
|
|
56
|
+
thumb = thumbnailer.get_thumbnail(
|
|
56
57
|
{'size': (830, 430), 'crop': True}
|
|
57
|
-
)
|
|
58
|
+
)
|
|
59
|
+
url = '/' + thumb.path.strip(settings.VAR_DIR)
|
|
58
60
|
request = get_current_request()
|
|
59
61
|
if request:
|
|
60
62
|
url = request.build_absolute_uri(url)
|
|
Binary file
|
simo/fleet/serializers.py
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
from rest_framework import serializers
|
|
2
|
-
from .models import InstanceOptions, Colonel, ColonelPin
|
|
2
|
+
from .models import InstanceOptions, Colonel, ColonelPin, Interface
|
|
3
3
|
|
|
4
4
|
|
|
5
5
|
class InstanceOptionsSerializer(serializers.ModelSerializer):
|
|
@@ -25,19 +25,28 @@ class ColonelPinSerializer(serializers.ModelSerializer):
|
|
|
25
25
|
return bool(obj.occupied_by)
|
|
26
26
|
|
|
27
27
|
|
|
28
|
+
class ColonelInterfaceSerializer(serializers.ModelSerializer):
|
|
29
|
+
|
|
30
|
+
class Meta:
|
|
31
|
+
model = Interface
|
|
32
|
+
fields = 'id', 'no', 'type'
|
|
33
|
+
read_only_fields = fields
|
|
34
|
+
|
|
35
|
+
|
|
28
36
|
class ColonelSerializer(serializers.ModelSerializer):
|
|
29
37
|
pins = serializers.SerializerMethodField()
|
|
38
|
+
interfaces = serializers.SerializerMethodField()
|
|
30
39
|
|
|
31
40
|
class Meta:
|
|
32
41
|
model = Colonel
|
|
33
42
|
fields = (
|
|
34
43
|
'id', 'uid', 'name', 'type', 'firmware_version', 'firmware_auto_update',
|
|
35
44
|
'socket_connected', 'last_seen', 'enabled', 'pwm_frequency',
|
|
36
|
-
'logs_stream', 'pins'
|
|
45
|
+
'logs_stream', 'pins', 'interfaces',
|
|
37
46
|
)
|
|
38
47
|
read_only_fields = [
|
|
39
48
|
'uid', 'type', 'firmware_version', 'socket_connected',
|
|
40
|
-
'last_seen', 'pins'
|
|
49
|
+
'last_seen', 'pins', 'interfaces',
|
|
41
50
|
]
|
|
42
51
|
|
|
43
52
|
def get_pins(self, obj):
|
|
@@ -46,6 +55,12 @@ class ColonelSerializer(serializers.ModelSerializer):
|
|
|
46
55
|
result.append(ColonelPinSerializer(pin).data)
|
|
47
56
|
return result
|
|
48
57
|
|
|
58
|
+
def get_interfaces(self, obj):
|
|
59
|
+
result = []
|
|
60
|
+
for interface in obj.interfaces.all():
|
|
61
|
+
result.append(ColonelInterfaceSerializer(interface).data)
|
|
62
|
+
return result
|
|
63
|
+
|
|
49
64
|
def update(self, instance, validated_data):
|
|
50
65
|
instance = super().update(instance, validated_data)
|
|
51
66
|
instance.update_config()
|
|
@@ -46,7 +46,7 @@ simo/core/middleware.py,sha256=64PYjnyRnYf4sgMvPfR0oQqf9UEtxUwnhJe3RV6z_HI,2040
|
|
|
46
46
|
simo/core/models.py,sha256=dPLPju4xxc46x9JciOTC65SFSPogboXyNxjwrewXB1Y,19400
|
|
47
47
|
simo/core/permissions.py,sha256=UmFjGPDWtAUbaWxJsWORb2q6BREHqndv9mkSIpnmdLk,1379
|
|
48
48
|
simo/core/routing.py,sha256=X1_IHxyA-_Q7hw1udDoviVP4_FSBDl8GYETTC2zWTbY,499
|
|
49
|
-
simo/core/serializers.py,sha256=
|
|
49
|
+
simo/core/serializers.py,sha256=HMSMOA5IcIYDIVipvuozf6bymJ-drvABPjEs-4lPjsI,17251
|
|
50
50
|
simo/core/signal_receivers.py,sha256=EZ8NSYZxUgSaLS16YZdK7T__l8dl0joMRllOxx5PUt4,2809
|
|
51
51
|
simo/core/socket_consumers.py,sha256=n7VE2Fvqt4iEAYLTRbTPOcI-7tszMAADu7gimBxB-Fg,9635
|
|
52
52
|
simo/core/storage.py,sha256=YlxmdRs-zhShWtFKgpJ0qp2NDBuIkJGYC1OJzqkbttQ,572
|
|
@@ -77,7 +77,7 @@ simo/core/__pycache__/middleware.cpython-38.pyc,sha256=bGOFJNEhJeLbpsZp8LYn1VA3p
|
|
|
77
77
|
simo/core/__pycache__/models.cpython-38.pyc,sha256=J3VZfFaU-aMkptCoviPvAJzJ8zBptGHmt504zjf2TCI,17006
|
|
78
78
|
simo/core/__pycache__/permissions.cpython-38.pyc,sha256=uygjPbfRQiEzyo5-McCxsuMDJLbDYO_TLu55U7bJbR0,1809
|
|
79
79
|
simo/core/__pycache__/routing.cpython-38.pyc,sha256=3T3FPJ8Cn99xZCGvMyg2xjl7al-Shm9CelbSpkJtNP8,599
|
|
80
|
-
simo/core/__pycache__/serializers.cpython-38.pyc,sha256=
|
|
80
|
+
simo/core/__pycache__/serializers.cpython-38.pyc,sha256=YkAXdCwfPEysAQ5Nin9B48cZ5pK_2WZwyR5ZEwfJrC4,16666
|
|
81
81
|
simo/core/__pycache__/signal_receivers.cpython-38.pyc,sha256=sgjH_wv-1U99auH5uHb3or0qettPeHAlsz8P7B03ajY,2430
|
|
82
82
|
simo/core/__pycache__/socket_consumers.cpython-38.pyc,sha256=NJUr7nRyHFvmAumxxWpsod5wzVVZM99rCEuJs1utHA4,8432
|
|
83
83
|
simo/core/__pycache__/storage.cpython-38.pyc,sha256=BTkYH8QQyjqI0WOtJC8fHNtgu0YA1vjqZclXjC2vCVI,1116
|
|
@@ -10174,7 +10174,7 @@ simo/fleet/gateways.py,sha256=KV5i5fxXIrlK-k6zyEkk83x11GJt-ELQ0npb4Ac83cM,3693
|
|
|
10174
10174
|
simo/fleet/managers.py,sha256=XOpDOA9L-f_550TNSyXnJbun2EmtGz1TenVTMlUSb8E,807
|
|
10175
10175
|
simo/fleet/models.py,sha256=1Wb9xPc61OtoiYu9aS4KezchPGZTC4CDxa2dqVhltqM,14161
|
|
10176
10176
|
simo/fleet/routing.py,sha256=cofGsVWXMfPDwsJ6HM88xxtRxHwERhJ48Xyxc8mxg5o,149
|
|
10177
|
-
simo/fleet/serializers.py,sha256=
|
|
10177
|
+
simo/fleet/serializers.py,sha256=LgSTnSI_sUhFXmW9-669keM6gmaSI_teaqMHEab4aL4,1972
|
|
10178
10178
|
simo/fleet/socket_consumers.py,sha256=Z-MooNN2HQccdhkynADJks5slbK9mGsnEpMLuA51H3I,18534
|
|
10179
10179
|
simo/fleet/tasks.py,sha256=AGq9BXFNAqkhOANsPvId8yjEbDtVCB3MRsi_AKDpgIM,821
|
|
10180
10180
|
simo/fleet/utils.py,sha256=2gcjbwQawsGw2edr_wm9q6XacGpYqO-gd4BF1t0Hg6U,3511
|
|
@@ -10191,7 +10191,7 @@ simo/fleet/__pycache__/gateways.cpython-38.pyc,sha256=YAcgTOqJbtjGI03lvEcU6keFfr
|
|
|
10191
10191
|
simo/fleet/__pycache__/managers.cpython-38.pyc,sha256=8uz-xpUiqbGDgXIZ_XRZtFb-Tju6NGxflGg-Ee4Yo6k,1310
|
|
10192
10192
|
simo/fleet/__pycache__/models.cpython-38.pyc,sha256=DQtRR6kI9bt3atgJ0pArCVfSyuutqb6SpxYrsBg10cM,12277
|
|
10193
10193
|
simo/fleet/__pycache__/routing.cpython-38.pyc,sha256=aPrCmxFKVyB8R8ZbJDwdPdFfvT7CvobovvZeq_mqRgY,314
|
|
10194
|
-
simo/fleet/__pycache__/serializers.cpython-38.pyc,sha256=
|
|
10194
|
+
simo/fleet/__pycache__/serializers.cpython-38.pyc,sha256=gwLIoLQJwkFoDCjKC_ikksNCYea3-mF8hVHFeKlOkbc,3098
|
|
10195
10195
|
simo/fleet/__pycache__/socket_consumers.cpython-38.pyc,sha256=RjzPD580096fby0HYLzZorm61zdZNOq5AHXmNAC4Yd8,13764
|
|
10196
10196
|
simo/fleet/__pycache__/tasks.cpython-38.pyc,sha256=RoNxL2WUiW67s9O9DjaYVVjCBSZu2nje0Qn9FJkWVS0,1116
|
|
10197
10197
|
simo/fleet/__pycache__/utils.cpython-38.pyc,sha256=dTuvW9MnhUycwdCc6eHYfHsMlvZw-CmEWXWYu18X8Uw,1955
|
|
@@ -10446,8 +10446,8 @@ simo/users/templates/invitations/expired_msg.html,sha256=47DEQpj8HBSa-_TImW-5JCe
|
|
|
10446
10446
|
simo/users/templates/invitations/expired_suggestion.html,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
10447
10447
|
simo/users/templates/invitations/taken_msg.html,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
10448
10448
|
simo/users/templates/invitations/taken_suggestion.html,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
10449
|
-
simo-2.0.
|
|
10450
|
-
simo-2.0.
|
|
10451
|
-
simo-2.0.
|
|
10452
|
-
simo-2.0.
|
|
10453
|
-
simo-2.0.
|
|
10449
|
+
simo-2.0.18.dist-info/LICENSE.md,sha256=M7wm1EmMGDtwPRdg7kW4d00h1uAXjKOT3HFScYQMeiE,34916
|
|
10450
|
+
simo-2.0.18.dist-info/METADATA,sha256=8siQqkBY_YIe8F8ZRhHunOOfyQmw3CZ9U2mZRLwXokk,1700
|
|
10451
|
+
simo-2.0.18.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
|
|
10452
|
+
simo-2.0.18.dist-info/top_level.txt,sha256=GmS1hrAbpVqn9OWZh6UX82eIOdRLgYA82RG9fe8v4Rs,5
|
|
10453
|
+
simo-2.0.18.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|