<commit_before># -*- coding: utf-8 -*-
from django.contrib import admin
from django.utils.translation import ugettext_lazy as _

from boris.syringes.models import SyringeCollection
from boris.utils.admin import BorisBaseAdmin, textual


class SyringeCollectionAdmin(BorisBaseAdmin):
    raw_id_fields = ('town', 'persons',)
    autocomplete_lookup_fields = {
        'fk': ('town',),
        'm2m': ('persons',),
    }
    list_display = ('date', 'town', 'location_display', 'count', 'user_list')
    list_filter = ('date', 'town', 'persons')
    date_hierarchy = 'date'

    @textual(_(u'Kdo'))
    def user_list(self, obj):
        return u'<br />'.join([unicode(s) for s in obj.persons.all()])

    @textual(_(u'Kde (např. u silnice)'), 'location')<commit_msg>Turn off autocomplete in syringe collection admin<commit_after># -*- coding: utf-8 -*-
from django.contrib import admin
from django.utils.translation import ugettext_lazy as _

from boris.syringes.models import SyringeCollection
from boris.utils.admin import BorisBaseAdmin, textual


class SyringeCollectionAdmin(BorisBaseAdmin):
    raw_id_fields = ('town',)
    autocomplete_lookup_fields = {
        'fk': ('town',),
    }
    list_display = ('date', 'town', 'location_display', 'count', 'user_list')
    list_filter = ('date', 'town', 'persons')
    date_hierarchy = 'date'

    @textual(_(u'Kdo'))
    def user_list(self, obj):
        return u'<br />'.join([unicode(s) for s in obj.persons.all()])

    @textual(_(u'Kde (např. u silnice)'), 'location')
{'fraction_non_alphanumeric': 0.15505913272010513, 'fraction_numerical': 0.0019710906701708277, 'mean_word_length': 4.14527027027027, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '7450856', 'n_tokens_mistral': 524, 'n_tokens_neox': 500, 'n_words': 120}