<commit_before>from django.db import models
from django.utils.translation import ugettext_lazy as _
from django.utils.translation import ungettext

from lemon import extradmin

from .models import Metadata
from .widgets import AdminSmallTextareaWidget


class MetadataAdmin(extradmin.ModelAdmin):

    list_display = (
        'url_path', 'title', 'title_extend', 'changefreq', 'language',
        'enabled',
    )
    list_display_links = ('title',)
    formfield_overrides = {
        models.TextField: {'widget': AdminSmallTextareaWidget},
    }
    string_overrides = {
        'add_title': _(u'Add metadata for page'),
        'change_title': _(u'Change metadata for page'),
        'changelist_title': _(u'Choose metadata to change'),
        'changelist_popup_title': _(u'Choose metadata'),
        'changelist_addlink_title': _(u'Add metadata'),
        'changelist_paginator_description': lambda n: ungettext(
            '%(count)d page has metadata', '%(count)d pages have metadata', n
        ),
    }


extradmin.site.register(Metadata, MetadataAdmin)<commit_msg>Metadata URL path is also a link to change form now<commit_after>from django.db import models
from django.utils.translation import ugettext_lazy as _
from django.utils.translation import ungettext

from lemon import extradmin

from .models import Metadata
from .widgets import AdminSmallTextareaWidget


class MetadataAdmin(extradmin.ModelAdmin):

    list_display = (
        'url_path', 'title', 'title_extend', 'changefreq', 'language',
        'enabled',
    )
    list_display_links = ('url_path', 'title')
    formfield_overrides = {
        models.TextField: {'widget': AdminSmallTextareaWidget},
    }
    string_overrides = {
        'add_title': _(u'Add metadata for page'),
        'change_title': _(u'Change metadata for page'),
        'changelist_title': _(u'Choose metadata to change'),
        'changelist_popup_title': _(u'Choose metadata'),
        'changelist_addlink_title': _(u'Add metadata'),
        'changelist_paginator_description': lambda n: ungettext(
            '%(count)d page has metadata', '%(count)d pages have metadata', n
        ),
    }


extradmin.site.register(Metadata, MetadataAdmin)
{'fraction_non_alphanumeric': 0.10904134484325306, 'fraction_numerical': 0.0, 'mean_word_length': 3.7456896551724137, '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': '5958144', 'n_tokens_mistral': 639, 'n_tokens_neox': 633, 'n_words': 164}