Skip to content

Commit ba8651a

Browse files
authored
Merge pull request #704 from bio-tools/develop
Update biotoolsSchema and add message in tool page
2 parents c94040a + d2747ef commit ba8651a

File tree

6 files changed

+3809
-2446
lines changed

6 files changed

+3809
-2446
lines changed

backend/elixir/serialization/resource_serialization/language.py

Lines changed: 90 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,98 @@
22
from elixir.models import *
33
from elixir.validators import *
44

5+
56
class LanguageSerializer(serializers.ModelSerializer):
6-
name = serializers.CharField(allow_blank=False, validators=[IsStringTypeValidator], required=False)
7+
name = serializers.CharField(
8+
allow_blank=False, validators=[IsStringTypeValidator], required=False
9+
)
710

8-
class Meta:
9-
model = Language
10-
fields = ('name',)
11+
class Meta:
12+
model = Language
13+
fields = ("name",)
1114

12-
def get_pk_field(self, model_field):
13-
return None
15+
def get_pk_field(self, model_field):
16+
return None
1417

15-
def to_representation(self, obj):
16-
return obj.name
18+
def to_representation(self, obj):
19+
return obj.name
1720

18-
# need to add validation here since this method overrides all validation
19-
def to_internal_value(self, data):
20-
# checking if blank
21-
IsNotBlankValidator(data)
22-
# checking if within enum
23-
enum = ENUMValidator(['ActionScript', 'Ada', 'AppleScript', 'Assembly language', 'AWK', 'Bash', 'C', 'C#', 'C++', 'COBOL', 'ColdFusion', 'CWL', 'D', 'Delphi', 'Dylan', 'Eiffel', 'Elm', 'Forth', 'Fortran', 'Groovy', 'Haskell', 'Icarus', 'Java', 'JavaScript', 'JSP', 'Julia', 'LabVIEW', 'Lisp', 'Lua', 'Maple', 'Mathematica', 'MATLAB', 'MLXTRAN', 'NMTRAN', 'OCaml', 'Pascal', 'Perl', 'PHP', 'Prolog', 'PyMOL', 'Python', 'R', 'Racket', 'REXX', 'Ruby', 'Rust', 'SAS', 'Scala', 'Scheme', 'Shell', 'Smalltalk', 'SQL', 'Turing', 'Verilog', 'VHDL', 'Visual Basic', 'XAML', 'Other'])
24-
data = enum(data)
25-
return {'name': data}
21+
# need to add validation here since this method overrides all validation
22+
def to_internal_value(self, data):
23+
# checking if blank
24+
IsNotBlankValidator(data)
25+
# checking if within enum
26+
enum = ENUMValidator(
27+
[
28+
"ActionScript",
29+
"Ada",
30+
"AppleScript",
31+
"Assembly language",
32+
"AWK",
33+
"Bash",
34+
"C",
35+
"C#",
36+
"C++",
37+
"Clojure",
38+
"COBOL",
39+
"Cython",
40+
"ColdFusion",
41+
"CUDA",
42+
"CWL",
43+
"D",
44+
"Delphi",
45+
"Dylan",
46+
"Eiffel",
47+
"Elm",
48+
"F#",
49+
"Forth",
50+
"Fortran",
51+
"Go",
52+
"Groovy",
53+
"Haskell",
54+
"Java",
55+
"JavaScript",
56+
"Julia",
57+
"Jython",
58+
"JSP",
59+
"Kotlin",
60+
"LabVIEW",
61+
"Lisp",
62+
"Lua",
63+
"Maple",
64+
"Mathematica",
65+
"MATLAB",
66+
"MLXTRAN",
67+
"NMTRAN",
68+
"OCaml",
69+
"Pascal",
70+
"Perl",
71+
"PHP",
72+
"Prolog",
73+
"PyMOL",
74+
"Python",
75+
"Q#",
76+
"QCL",
77+
"R",
78+
"Racket",
79+
"REXX",
80+
"Ruby",
81+
"Rust",
82+
"SAS",
83+
"Scala",
84+
"Scheme",
85+
"Shell",
86+
"Smalltalk",
87+
"SQL",
88+
"Swift",
89+
"Turing",
90+
"TypeScript",
91+
"Verilog",
92+
"VHDL",
93+
"Visual Basic",
94+
"XAML",
95+
"Other",
96+
]
97+
)
98+
data = enum(data)
99+
return {"name": data}

backend/elixir/serialization/resource_serialization/operatingSystem.py

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,27 @@
22
from elixir.models import *
33
from elixir.validators import *
44

5+
56
class OperatingSystemSerializer(serializers.ModelSerializer):
6-
name = serializers.CharField(allow_blank=False, validators=[IsStringTypeValidator], required=False)
7+
name = serializers.CharField(
8+
allow_blank=False, validators=[IsStringTypeValidator], required=False
9+
)
710

8-
class Meta:
9-
model = OperatingSystem
10-
fields = ('name',)
11+
class Meta:
12+
model = OperatingSystem
13+
fields = ("name",)
1114

12-
def get_pk_field(self, model_field):
13-
return None
15+
def get_pk_field(self, model_field):
16+
return None
1417

15-
def to_representation(self, obj):
16-
return obj.name
18+
def to_representation(self, obj):
19+
return obj.name
1720

18-
# need to add validation here since this method overrides all validation
19-
def to_internal_value(self, data):
20-
# checking if blank
21-
IsNotBlankValidator(data)
22-
# check if length is not exceeded
23-
enum = ENUMValidator(['Mac', 'Linux', 'Windows'])
24-
data = enum(data)
25-
return {'name': data}
21+
# need to add validation here since this method overrides all validation
22+
def to_internal_value(self, data):
23+
# checking if blank
24+
IsNotBlankValidator(data)
25+
# check if length is not exceeded
26+
enum = ENUMValidator(["Mac", "Linux", "Windows", "Android", "iOS"])
27+
data = enum(data)
28+
return {"name": data}

0 commit comments

Comments
 (0)