Django ORM queries
from django.contrib.auth.models import User from django.db import models
class CUser(User): score = models.IntegerField()
The custom user has an additional field ("score"), we want to do the following operations using ORM queries only. Every answer must have a single query:
Calculate the mean score of all users.
Find the user with the highest score.
Find if there is any user with score less than 2 (return True/False)
Find all the users which have score exactly equal to the mean score (need to calculate mean score again in the same query).
Change the score value of all users in a single query to 100 (one hundred)
Find all the users which don't have score 10 or 20
Print a list of all the score values from all users excluding the first 10 users.