Beracles commited on
Commit
3bb05d0
·
1 Parent(s): aaec2b6

modify body field

Browse files
Files changed (2) hide show
  1. app/bodys.py +7 -7
  2. app/watermelon.py +5 -5
app/bodys.py CHANGED
@@ -5,34 +5,34 @@ class FeatureNoArg(BaseModel):
5
  command: str
6
 
7
  class Config:
8
- frome_attributes = True
9
 
10
  class FeatureOneIntegerArg(BaseModel):
11
  command: str
12
  integer: int
13
 
14
  class Config:
15
- frome_attributes = True
16
 
17
  class FeatureOneStringArg(BaseModel):
18
  command: str
19
- string: str
20
 
21
  class Config:
22
- frome_attributes = True
23
 
24
  class FeatureStringAndIntegerArg(BaseModel):
25
  command: str
26
- string: str
27
  integer: int
28
 
29
  class Config:
30
- frome_attributes = True
31
 
32
 
33
  class FeatureStringAndDecimalArg(BaseModel):
34
  command: str
35
- string: str
36
  decimal: float
37
 
38
  class Config:
 
5
  command: str
6
 
7
  class Config:
8
+ from_attributes = True
9
 
10
  class FeatureOneIntegerArg(BaseModel):
11
  command: str
12
  integer: int
13
 
14
  class Config:
15
+ from_attributes = True
16
 
17
  class FeatureOneStringArg(BaseModel):
18
  command: str
19
+ target: str
20
 
21
  class Config:
22
+ from_attributes = True
23
 
24
  class FeatureStringAndIntegerArg(BaseModel):
25
  command: str
26
+ target: str
27
  integer: int
28
 
29
  class Config:
30
+ from_attributes = True
31
 
32
 
33
  class FeatureStringAndDecimalArg(BaseModel):
34
  command: str
35
+ target: str
36
  decimal: float
37
 
38
  class Config:
app/watermelon.py CHANGED
@@ -160,7 +160,7 @@ def set_number_of_something(feature: FeatureStringAndIntegerArg, response: Respo
160
  "detail": "command already exists in memory",
161
  "count": train_generated.__len__(),
162
  }
163
- target=feature.string.strip()
164
  if target not in [x_fruit, x_prop, x_swap_card, x_lightning, x_bomb, x_freeze]:
165
  response.status_code = status.HTTP_500_INTERNAL_SERVER_ERROR
166
  return {
@@ -205,7 +205,7 @@ def delete_all_of_something(feature: FeatureOneStringArg, response: Response):
205
  "detail": "command already exists in memory",
206
  "count": train_generated.__len__(),
207
  }
208
- target=feature.string.strip()
209
  if target not in [x_fruit, x_prop, x_swap_card, x_lightning, x_bomb, x_freeze]:
210
  response.status_code = status.HTTP_500_INTERNAL_SERVER_ERROR
211
  return {
@@ -251,7 +251,7 @@ def delete_something(feature: FeatureStringAndIntegerArg, response: Response):
251
  "detail": "command already exists in memory",
252
  "count": train_generated.__len__(),
253
  }
254
- target=feature.string.strip()
255
  if target not in [x_fruit, x_prop, x_swap_card, x_lightning, x_bomb, x_freeze]:
256
  response.status_code = status.HTTP_500_INTERNAL_SERVER_ERROR
257
  return {
@@ -294,7 +294,7 @@ def add_fruit_type(feature: FeatureOneStringArg, response: Response):
294
  "detail": "command already exists in memory",
295
  "count": train_generated.__len__(),
296
  }
297
- fruit_type=feature.string.strip().upper()
298
  if len(fruit_type) != 1 or fruit_type>"Z" or fruit_type < "A":
299
  response.status_code = status.HTTP_500_INTERNAL_SERVER_ERROR
300
  return {
@@ -339,7 +339,7 @@ def set_fruit_odds(feature: FeatureStringAndDecimalArg, response: Response):
339
  "detail": "command already exists in memory",
340
  "count": train_generated.__len__(),
341
  }
342
- fruit_type=feature.string.strip().upper()
343
  if len(fruit_type) != 1 or fruit_type>"Z" or fruit_type < "A":
344
  response.status_code = status.HTTP_500_INTERNAL_SERVER_ERROR
345
  return {
 
160
  "detail": "command already exists in memory",
161
  "count": train_generated.__len__(),
162
  }
163
+ target=feature.target.strip()
164
  if target not in [x_fruit, x_prop, x_swap_card, x_lightning, x_bomb, x_freeze]:
165
  response.status_code = status.HTTP_500_INTERNAL_SERVER_ERROR
166
  return {
 
205
  "detail": "command already exists in memory",
206
  "count": train_generated.__len__(),
207
  }
208
+ target=feature.target.strip()
209
  if target not in [x_fruit, x_prop, x_swap_card, x_lightning, x_bomb, x_freeze]:
210
  response.status_code = status.HTTP_500_INTERNAL_SERVER_ERROR
211
  return {
 
251
  "detail": "command already exists in memory",
252
  "count": train_generated.__len__(),
253
  }
254
+ target=feature.target.strip()
255
  if target not in [x_fruit, x_prop, x_swap_card, x_lightning, x_bomb, x_freeze]:
256
  response.status_code = status.HTTP_500_INTERNAL_SERVER_ERROR
257
  return {
 
294
  "detail": "command already exists in memory",
295
  "count": train_generated.__len__(),
296
  }
297
+ fruit_type=feature.target.strip().upper()
298
  if len(fruit_type) != 1 or fruit_type>"Z" or fruit_type < "A":
299
  response.status_code = status.HTTP_500_INTERNAL_SERVER_ERROR
300
  return {
 
339
  "detail": "command already exists in memory",
340
  "count": train_generated.__len__(),
341
  }
342
+ fruit_type=feature.target.strip().upper()
343
  if len(fruit_type) != 1 or fruit_type>"Z" or fruit_type < "A":
344
  response.status_code = status.HTTP_500_INTERNAL_SERVER_ERROR
345
  return {