<commit_before>
from django.contrib import admin
from feedback.models import Feedback

class FeedbackAdmin(admin.ModelAdmin):
    list_display = ['pub_date', 'kind', 'text', 'version']
    fields = ('kind', 'text', 'version', 'ip_address')
    readonly_fields = ('ip_address', )
    list_filter = ('pub_date', 'kind', 'version')
    date_hierarchy = 'pub_date'


admin.site.register(Feedback, FeedbackAdmin)<commit_msg>Save IP address in admin view<commit_after>
from django.contrib import admin
from feedback.models import Feedback

class FeedbackAdmin(admin.ModelAdmin):
    list_display = ['pub_date', 'kind', 'text', 'version']
    fields = ('kind', 'text', 'version', 'ip_address')
    readonly_fields = ('ip_address', )
    list_filter = ('pub_date', 'kind', 'version')
    date_hierarchy = 'pub_date'

    def save_model(self, request, obj, form, change):
        obj.ip_address = request.META['REMOTE_ADDR']
        obj.save()



admin.site.register(Feedback, FeedbackAdmin)
{'fraction_non_alphanumeric': 0.14358452138492872, 'fraction_numerical': 0.0, 'mean_word_length': 4.816568047337278, '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': '7083942', 'n_tokens_mistral': 319, 'n_tokens_neox': 305, 'n_words': 75}