<commit_before>from django.contrib import admin
from django.conf import settings
from django.utils.translation import ugettext as _

from feincms.admin import editor

class LumpyContentAdmin(editor.ItemEditor):
    
    def get_template_list(self):
        opts = self.model._meta
        return [
            'admin/%s/%s/item_editor.html' % (
                opts.app_label, opts.object_name.lower()),
            'admin/%s/item_editor.html' % opts.app_label
            ] + super(LumpyContentAdmin, self).get_template_list()
    
class HierarchicalLumpyContentAdmin(LumpyContentAdmin, editor.TreeEditor):
    raw_id_fields = ('parent',)

    def _actions_column(self, content):
        actions = super(HierarchicalLumpyContentAdmin, self)._actions_column(
            content)
        actions.insert(0, u'<a href="add/?parent=%s" title="%s"><img src="%simg/admin/icon_addlink.gif" alt="%s"></a>' % (content.pk, _('Add child content'), settings.ADMIN_MEDIA_PREFIX ,_('Add child content')))
        if hasattr(content, 'get_absolute_url'):
            actions.insert(0, u'<a href="%s" title="%s"><img src="%simg/admin/selector-search.gif" alt="%s" /></a>' % (content.get_absolute_url(), _('View on site'), settings.ADMIN_MEDIA_PREFIX, _('View on site')))
        return actions

ADMIN_THUMBNAIL_SIZE = (100, 100)

class ImageAdmin(admin.ModelAdmin):
    list_display = ('name', 'admin_thumbnail',)
    list_filter = ('category',)
    search_fields = ('name', 'category__name',)
    
    def admin_thumbnail(self, image):
        return '<img src="%s" />' % (
            image.get_thumbnail(size=ADMIN_THUMBNAIL_SIZE).url)
    admin_thumbnail.allow_tags = True
    admin_thumbnail.short_description = 'Thumbnail'<commit_msg>Removed obsolete reference to 'category' from ImageAdmin<commit_after>from django.contrib import admin
from django.conf import settings
from django.utils.translation import ugettext as _

from feincms.admin import editor

class LumpyContentAdmin(editor.ItemEditor):
    
    def get_template_list(self):
        opts = self.model._meta
        return [
            'admin/%s/%s/item_editor.html' % (
                opts.app_label, opts.object_name.lower()),
            'admin/%s/item_editor.html' % opts.app_label
            ] + super(LumpyContentAdmin, self).get_template_list()
    
class HierarchicalLumpyContentAdmin(LumpyContentAdmin, editor.TreeEditor):
    raw_id_fields = ('parent',)

    def _actions_column(self, content):
        actions = super(HierarchicalLumpyContentAdmin, self)._actions_column(
            content)
        actions.insert(0, u'<a href="add/?parent=%s" title="%s"><img src="%simg/admin/icon_addlink.gif" alt="%s"></a>' % (content.pk, _('Add child content'), settings.ADMIN_MEDIA_PREFIX ,_('Add child content')))
        if hasattr(content, 'get_absolute_url'):
            actions.insert(0, u'<a href="%s" title="%s"><img src="%simg/admin/selector-search.gif" alt="%s" /></a>' % (content.get_absolute_url(), _('View on site'), settings.ADMIN_MEDIA_PREFIX, _('View on site')))
        return actions

ADMIN_THUMBNAIL_SIZE = (100, 100)

class ImageAdmin(admin.ModelAdmin):
    list_display = ('admin_thumbnail', 'name',)
    search_fields = ('name',)
    
    def admin_thumbnail(self, image):
        return '<img src="%s" />' % (
            image.get_thumbnail(size=ADMIN_THUMBNAIL_SIZE).url)
    admin_thumbnail.allow_tags = True
    admin_thumbnail.short_description = 'Thumbnail'
{'fraction_non_alphanumeric': 0.13912285797269822, 'fraction_numerical': 0.004647110078419983, 'mean_word_length': 3.7113543091655266, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 17, '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': '4187720', 'n_tokens_mistral': 1115, 'n_tokens_neox': 1095, 'n_words': 204}