<commit_before>from __future__ import unicode_literals
from django.contrib import admin
from django.db import models
import reversion
from stagecraft.apps.datasets.models.backdrop_user import BackdropUser
from stagecraft.apps.datasets.models.data_set import DataSet


class DataSetInline(admin.StackedInline):
    model = DataSet
    fields = ('name',)
    extra = 0


class BackdropUserAdmin(reversion.VersionAdmin):
    search_fields = ['email', 'data_sets']
    list_display = ('email', 'numer_of_datasets_user_has_access_to',)
    list_per_page = 30

    def queryset(self, request):
        return BackdropUser.objects.annotate(
            dataset_count=models.Count('data_sets')<commit_msg>Add filter_horizontal to backdrop user admin<commit_after>from __future__ import unicode_literals
from django.contrib import admin
from django.db import models
import reversion
from stagecraft.apps.datasets.models.backdrop_user import BackdropUser
from stagecraft.apps.datasets.models.data_set import DataSet


class DataSetInline(admin.StackedInline):
    model = DataSet
    fields = ('name',)
    extra = 0


class BackdropUserAdmin(reversion.VersionAdmin):
    search_fields = ['email', 'data_sets']
    list_display = ('email', 'numer_of_datasets_user_has_access_to',)
    list_per_page = 30
    filter_horizontal = ('data_sets',)

    def queryset(self, request):
        return BackdropUser.objects.annotate(
            dataset_count=models.Count('data_sets')
{'fraction_non_alphanumeric': 0.0860655737704918, 'fraction_numerical': 0.004098360655737705, 'mean_word_length': 4.836653386454183, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1880511', 'n_tokens_mistral': 443, 'n_tokens_neox': 431, 'n_words': 98}