Spaces:
Running
Running
added star url
Browse files- gamification/objects.py +27 -0
gamification/objects.py
CHANGED
@@ -247,11 +247,35 @@ class individualPoints(BaseModel):
|
|
247 |
trendingTech:Optional[dict]=None
|
248 |
skillGapTargeting:Optional[dict]=None
|
249 |
focusMode:Optional[dict]=None
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
250 |
class Config:
|
251 |
json_encoders={
|
252 |
ObjectId:str
|
253 |
}
|
254 |
|
|
|
|
|
255 |
|
256 |
class IndividualUserLevel(BaseModel):
|
257 |
totalpoints:float
|
@@ -259,8 +283,11 @@ class IndividualUserLevel(BaseModel):
|
|
259 |
levelNumber:int
|
260 |
maxPoints:float
|
261 |
minPoints:float
|
|
|
262 |
individualPoints:List[individualPoints]
|
263 |
|
|
|
|
|
264 |
|
265 |
class Config:
|
266 |
json_encoders = {
|
|
|
247 |
trendingTech:Optional[dict]=None
|
248 |
skillGapTargeting:Optional[dict]=None
|
249 |
focusMode:Optional[dict]=None
|
250 |
+
starUrl:Optional[str]="https://iili.io/37bdMPe.png"
|
251 |
+
|
252 |
+
@model_validator(mode='after')
|
253 |
+
def change_star_url(cls,values):
|
254 |
+
weekendWarriorPM = values.get("weekendWarrior")
|
255 |
+
trendingTechPM=values.get("trendingTech")
|
256 |
+
skillGapTargetingPM=values.get("skillGapTargeting")
|
257 |
+
focusModePM=values.get("focusMode")
|
258 |
+
a=0
|
259 |
+
if weekendWarriorPM !=None:
|
260 |
+
a=a+1
|
261 |
+
if trendingTechPM !=None:
|
262 |
+
a=a+1
|
263 |
+
if skillGapTargetingPM !=None:
|
264 |
+
a=a+1
|
265 |
+
if focusModePM!=None:
|
266 |
+
a=a+1
|
267 |
+
if a==1 or a==2:
|
268 |
+
values['starUrl']=='https://iili.io/37b2RWP.png'
|
269 |
+
elif a==3 or a==4:
|
270 |
+
values['starUrl']=='https://iili.io/37b3Yj2.png'
|
271 |
+
|
272 |
class Config:
|
273 |
json_encoders={
|
274 |
ObjectId:str
|
275 |
}
|
276 |
|
277 |
+
|
278 |
+
|
279 |
|
280 |
class IndividualUserLevel(BaseModel):
|
281 |
totalpoints:float
|
|
|
283 |
levelNumber:int
|
284 |
maxPoints:float
|
285 |
minPoints:float
|
286 |
+
|
287 |
individualPoints:List[individualPoints]
|
288 |
|
289 |
+
|
290 |
+
|
291 |
|
292 |
class Config:
|
293 |
json_encoders = {
|