django-restit 4.1.39__py3-none-any.whl → 4.1.40__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.
- {django_restit-4.1.39.dist-info → django_restit-4.1.40.dist-info}/METADATA +1 -1
- {django_restit-4.1.39.dist-info → django_restit-4.1.40.dist-info}/RECORD +7 -7
- rest/__init__.py +1 -1
- rest/serializers/csv.py +29 -25
- rest/serializers/legacy.py +1 -0
- {django_restit-4.1.39.dist-info → django_restit-4.1.40.dist-info}/LICENSE.md +0 -0
- {django_restit-4.1.39.dist-info → django_restit-4.1.40.dist-info}/WHEEL +0 -0
@@ -343,7 +343,7 @@ pushit/utils.py,sha256=IeTCGa-164nmB1jIsK1lu1O1QzUhS3BKfuXHGjCW-ck,2121
|
|
343
343
|
rest/.gitignore,sha256=TbEvWRMnAiajCTOdhiNrd9eeCAaIjRp9PRjE_VkMM5g,118
|
344
344
|
rest/README.md,sha256=V3ETc-cJu8PZIbKr9xSe_pA4JEUpC8Dhw4bQeVCDJPw,5460
|
345
345
|
rest/RemoteEvents.py,sha256=nL46U7AuxIrlw2JunphR1tsXyqi-ep_gD9CYGpYbNgE,72
|
346
|
-
rest/__init__.py,sha256=
|
346
|
+
rest/__init__.py,sha256=qEmZBxIJWeZCVLWbDDx_XIDFv831Xv6nqEGRAnU33JA,121
|
347
347
|
rest/arc4.py,sha256=y644IbF1ec--e4cUJ3KEYsewTCITK0gmlwa5mJruFC0,1967
|
348
348
|
rest/cache.py,sha256=1Qg0rkaCJCaVP0-l5hZg2CIblTdeBSlj_0fP6vlKUpU,83
|
349
349
|
rest/crypto/__init__.py,sha256=Tl0U11rgj1eBYqd6OXJ2_XSdNLumW_JkBZnaJqI6Ldw,72
|
@@ -385,10 +385,10 @@ rest/rpc.py,sha256=8n6LdtUyLqpwvdH1dtVT1e2ODYxOj1CEYs8mm_-vqwA,3612
|
|
385
385
|
rest/search.py,sha256=UPnUldROiq65KmnEn-FIsgnpxk0wcXVu7I2NGfB7A-Q,7645
|
386
386
|
rest/serializers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
387
387
|
rest/serializers/collection.py,sha256=7vDmuz6alautQVr9VsVCFQdQdJcZR9tkrOEs2b_mKQw,2015
|
388
|
-
rest/serializers/csv.py,sha256=
|
388
|
+
rest/serializers/csv.py,sha256=CVD0erB2Ebl7mqgrMAZ2FxZSZpyVDCoSS4FHiEjuvDM,3252
|
389
389
|
rest/serializers/excel.py,sha256=KtxqZZU5Huzo31tyVVWbshMudeSAImKLO71ufQQt0-c,1077
|
390
390
|
rest/serializers/json.py,sha256=R1has2PZQuXacA6WwfdrBnMG4rSM6CrnXQOhGoAU6Dk,1736
|
391
|
-
rest/serializers/legacy.py,sha256=
|
391
|
+
rest/serializers/legacy.py,sha256=LgU8Sr7yFoiOso1Tb-LkJ-vphGcbEc4BKuSCCuD62R8,61800
|
392
392
|
rest/serializers/model.py,sha256=kbwtREE--n7YKUfTzErfYhHsgiuqnLdS52z1owrXaQI,7532
|
393
393
|
rest/serializers/profiler.py,sha256=OxOimhEyvCAuzUBC9Q1dz2xaakjAqmSnekMATsjduXM,997
|
394
394
|
rest/serializers/response.py,sha256=8PtxZznl8E_OQbCA1epIHcMxSJJYf9VOW_syXh19nz4,6509
|
@@ -474,7 +474,7 @@ ws4redis/servers/uwsgi.py,sha256=VyhoCI1DnVFqBiJYHoxqn5Idlf6uJPHvfBKgkjs34mo,172
|
|
474
474
|
ws4redis/settings.py,sha256=K0yBiLUuY81iDM4Yr-k8hbvjn5VVHu5zQhmMK8Dtz0s,1536
|
475
475
|
ws4redis/utf8validator.py,sha256=S0OlfjeGRP75aO6CzZsF4oTjRQAgR17OWE9rgZdMBZA,5122
|
476
476
|
ws4redis/websocket.py,sha256=R0TUyPsoVRD7Y_oU7w2I6NL4fPwiz5Vl94-fUkZgLHA,14848
|
477
|
-
django_restit-4.1.
|
478
|
-
django_restit-4.1.
|
479
|
-
django_restit-4.1.
|
480
|
-
django_restit-4.1.
|
477
|
+
django_restit-4.1.40.dist-info/LICENSE.md,sha256=VHN4hhEeVOoFjtG-5fVv4jesA4SWi0Z-KgOzzN6a1ps,1068
|
478
|
+
django_restit-4.1.40.dist-info/METADATA,sha256=Sm4DNuvkHqUeY2ZqBYmql_qo9BrmwWxp6Usuj02yjAU,7573
|
479
|
+
django_restit-4.1.40.dist-info/WHEEL,sha256=Zb28QaM1gQi8f4VCBhsUklF61CTlNYfs9YAZn-TOGFk,88
|
480
|
+
django_restit-4.1.40.dist-info/RECORD,,
|
rest/__init__.py
CHANGED
rest/serializers/csv.py
CHANGED
@@ -5,38 +5,42 @@ import csv
|
|
5
5
|
|
6
6
|
|
7
7
|
def flattenObject(obj, field_names):
|
8
|
-
NOT_FOUND = "-!@#$%^&*()-"
|
9
|
-
|
10
8
|
row = []
|
11
9
|
for f in field_names:
|
12
|
-
d =
|
13
|
-
if
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
10
|
+
d = ""
|
11
|
+
if "__" in f:
|
12
|
+
f = f.replace("__", ".")
|
13
|
+
if "." in f:
|
14
|
+
# we could use obj.getFieldValue
|
15
|
+
keys = f.split('.')
|
16
|
+
f1 = keys[0]
|
17
|
+
f2 = keys[1]
|
18
|
+
if f1 == "metadata" and hasattr(obj, "getProperty"):
|
19
|
+
if len(keys) > 2:
|
20
|
+
d = obj.getProperty(f2, category=keys[2])
|
21
|
+
else:
|
22
|
+
d = obj.getProperty(f2)
|
23
|
+
elif hasattr(obj, "getFieldValue"):
|
24
|
+
d = obj.getFieldValue(f, "t/a")
|
24
25
|
if callable(d):
|
25
26
|
d = d()
|
26
27
|
else:
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
if
|
34
|
-
|
35
|
-
d = getattr(d1, f2, "")
|
36
|
-
else:
|
37
|
-
d = ""
|
28
|
+
d1 = getattr(obj, f1, None)
|
29
|
+
if d1 is not None:
|
30
|
+
if not hasattr(d1, f2):
|
31
|
+
if hasattr(d1, "first"):
|
32
|
+
d1 = d1.first()
|
33
|
+
d = getattr(d1, f2, "")
|
34
|
+
if callable(d):
|
35
|
+
d = d()
|
38
36
|
else:
|
37
|
+
d = getattr(obj, f, "n/a")
|
38
|
+
if callable(d):
|
39
|
+
d = d()
|
40
|
+
if d is None:
|
39
41
|
d = "n/a"
|
42
|
+
elif hasattr(d, "pk"):
|
43
|
+
d = d.pk
|
40
44
|
row.append(str(d))
|
41
45
|
return row
|
42
46
|
|
rest/serializers/legacy.py
CHANGED
File without changes
|
File without changes
|