Count files each user has uploaded and approved
问题 I am building a Django app for uploading files. I would like to be able to count the number of files a users has and which are approved. I have a model with a Boolean 'approved' field. This model is in admin.py. In admin.py from django.contrib import admin from .models import FileModel from .forms import FileForm class FileModelAdmin(admin.ModelAdmin): form = FileForm fields = ('title', 'description', 'categories', 'pub_date', 'submitted_date', 'author', 'user', 'approved', 'upload', 'vote')