def get_user_activity_records_for_email(email: str) -> List[QuerySet]:
    fields = ['user_profile__full_name', 'query', 'client__name', 'count', 'last_visit']
    records = UserActivity.objects.filter(user_profile__delivery_email=email)
    records = records.order_by('-last_visit')
    records = records.select_related('user_profile', 'client').only(*fields)
    return records
def get_user_activity_records_for_email(email: str) -> List[QuerySet]:
    fields = ['user_profile__full_name', 'query', 'client__name', 'count', 'last_visit']
    records = UserActivity.objects.filter(user_profile__delivery_email=email)
    records = records.order_by('-last_visit')
    records = records.select_related('user_profile', 'client').only(*fields)
    return records