Download apps/gamification/services.py from ecocyclehub-capstone-dicoding/ecocyclehub-api: direct link, hf CLI and curl.
- Browser
- Download file 170 Bytes
-
https://huggingface.co/spaces/ecocyclehub-capstone-dicoding/ecocyclehub-api/resolve/main/apps/gamification/services.py
- Command line
-
hf download hf://spaces/ecocyclehub-capstone-dicoding/ecocyclehub-api/apps/gamification/services.py
-
curl -L -o services.py https://huggingface.co/spaces/ecocyclehub-capstone-dicoding/ecocyclehub-api/resolve/main/apps/gamification/services.py
170 Bytes
| from .models import Level | |
| def get_user_level(total_points): | |
| return Level.objects.filter( | |
| min_points__lte=total_points | |
| ).order_by("-min_points").first() | |