<commit_before>from django.contrib import admin
from django.conf.urls.defaults import patterns
from invoice.models import Invoice, InvoiceItem
from invoice.views import pdf_view
from invoice.forms import InvoiceAdminForm


class InvoiceItemInline(admin.TabularInline):
    model = InvoiceItem


class InvoiceAdmin(admin.ModelAdmin):
    inlines = [InvoiceItemInline,]
    fieldsets = (
        (None, {
            'fields': ('user', 'address', 'status')
        }),
        ('Dates', {
            'fields': ('invoice_date', 'due_date', 'paid_date')
        }),
    )
    search_fields = ('invoice_id', 'user__username')
    list_filter = ('status',)
    list_display = (
        'invoice_id',
        'user',
        'invoice_date',
        'due_date',
        'status',
        'total_amount',
    )
    form = InvoiceAdminForm

    def get_urls(self):
        urls = super(InvoiceAdmin, self).get_urls()
        return patterns('',
            (r'^(.+)/pdf/$', self.admin_site.admin_view(pdf_view))
        ) + urls


admin.site.register(Invoice, InvoiceAdmin)<commit_msg>Add paid_date to invoice list.<commit_after>from django.contrib import admin
from django.conf.urls.defaults import patterns
from invoice.models import Invoice, InvoiceItem
from invoice.views import pdf_view
from invoice.forms import InvoiceAdminForm


class InvoiceItemInline(admin.TabularInline):
    model = InvoiceItem


class InvoiceAdmin(admin.ModelAdmin):
    inlines = [InvoiceItemInline,]
    fieldsets = (
        (None, {
            'fields': ('user', 'address', 'status')
        }),
        ('Dates', {
            'fields': ('invoice_date', 'due_date', 'paid_date')
        }),
    )
    search_fields = ('invoice_id', 'user__username')
    list_filter = ('status',)
    list_display = (
        'invoice_id',
        'user',
        'invoice_date',
        'due_date',
        'paid_date',
        'status',
        'total_amount',
    )
    form = InvoiceAdminForm

    def get_urls(self):
        urls = super(InvoiceAdmin, self).get_urls()
        return patterns('',
            (r'^(.+)/pdf/$', self.admin_site.admin_view(pdf_view))
        ) + urls


admin.site.register(Invoice, InvoiceAdmin)
{'fraction_non_alphanumeric': 0.13059360730593608, 'fraction_numerical': 0.0, 'mean_word_length': 2.7198641765704585, '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': '4577940', 'n_tokens_mistral': 687, 'n_tokens_neox': 662, 'n_words': 136}