<commit_before># -*- coding: utf-8 -*-
from __future__ import print_function
from __future__ import unicode_literals
from __future__ import division

from django.contrib import admin
import apps.survey.models as m


class TreeInline(admin.TabularInline):
    extra = 0
    model = m.Tree


class SurveyAdmin(admin.ModelAdmin):
    inlines = [TreeInline]
    search_fields = ('id', 'quit_reason', 'user__username')
    list_display = ('blockface', 'user', 'has_trees',
                    'is_flagged', 'teammate', 'quit_reason')
    list_filter = ('is_flagged', 'has_trees')

admin.site.register(m.Blockface)
admin.site.register(m.Territory)
admin.site.register(m.Survey, SurveyAdmin)
admin.site.register(m.Tree)
admin.site.register(m.BlockfaceReservation)
admin.site.register(m.Species)
<commit_msg>Don't load all blockfaces to an admin site dropdown<commit_after># -*- coding: utf-8 -*-
from __future__ import print_function
from __future__ import unicode_literals
from __future__ import division

from django.contrib import admin
import apps.survey.models as m


class TreeInline(admin.TabularInline):
    extra = 0
    model = m.Tree


class SurveyAdmin(admin.ModelAdmin):
    inlines = [TreeInline]
    search_fields = ('id', 'quit_reason', 'user__username')
    list_display = ('blockface', 'user', 'has_trees',
                    'is_flagged', 'teammate', 'quit_reason')
    list_filter = ('is_flagged', 'has_trees')
    raw_id_fields = ("blockface",)


class BlockfaceReservationAdmin(admin.ModelAdmin):
    raw_id_fields = ("blockface",)


admin.site.register(m.Blockface)
admin.site.register(m.Territory)
admin.site.register(m.Survey, SurveyAdmin)
admin.site.register(m.Tree)
admin.site.register(m.BlockfaceReservation, BlockfaceReservationAdmin)
admin.site.register(m.Species)

{'fraction_non_alphanumeric': 0.12073784237003912, 'fraction_numerical': 0.0022358859698155395, 'mean_word_length': 4.737179487179487, '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': '5812417', 'n_tokens_mistral': 589, 'n_tokens_neox': 570, 'n_words': 123}