Browse Source

[json_backend] pylint+pep8 on json_backend.py

Roland Haroutiounian 9 years ago
parent
commit
53c3f1f687
1 changed files with 14 additions and 13 deletions
  1. 14
    13
      EditorialModel/backend/json_backend.py

+ 14
- 13
EditorialModel/backend/json_backend.py View File

@@ -7,38 +7,39 @@ import json
7 7
 import datetime
8 8
 from Lodel.utils.mlstring import MlString
9 9
 
10
+
10 11
 def date_cast(date):
11 12
     if len(date):
12 13
         return datetime.datetime(date)
13 14
     else:
14 15
         return None
15 16
 
17
+
16 18
 def int_or_none(i):
17 19
     if len(i):
18 20
         return int(i)
19 21
     else:
20 22
         return None
21 23
 
24
+
22 25
 ## Manages a Json file based backend structure
23 26
 class EmBackendJson(object):
24 27
 
25 28
     cast_methods = {
26
-        'uid' : int,
27
-        'rank' : int,
28
-        'class_id' : int,
29
-        'fieldgroup_id' : int,
30
-        'rel_to_type_id' : int_or_none,
31
-        'rel_field_id' : int_or_none,
32
-        'optional' : bool,
29
+        'uid': int,
30
+        'rank': int,
31
+        'class_id': int,
32
+        'fieldgroup_id': int,
33
+        'rel_to_type_id': int_or_none,
34
+        'rel_field_id': int_or_none,
35
+        'optional': bool,
33 36
         'internal': bool,
34
-        'string' : MlString.load,
35
-        'help_text' : MlString.load,
36
-        'date_create' : date_cast,
37
-        'date_update' : date_cast,
37
+        'string': MlString.load,
38
+        'help_text': MlString.load,
39
+        'date_create': date_cast,
40
+        'date_update': date_cast,
38 41
     }
39 42
 
40
-        
41
-
42 43
     ## Constructor
43 44
     #
44 45
     # @param json_file str: path to the json_file used as data source

Loading…
Cancel
Save