﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
24976	admin.TabularInline custom form field header displaying as None on admin page	Kartik Anand	matiasb	"While using admin.TabularInline with a custom form, for any form field if one doesn't specify a label, then it would come up as ""None"" on admin page, but one doesn't need to specify it for admin.StackedInline.

Attached Image

To reproduce:

{{{
models.py

from django.db import models

class Foo(models.Model):
    title = models.CharField(max_length=128)

    class Meta:
        verbose_name = ""Foo""
        verbose_name_plural = ""Foo""

    def __str__(self):
        pass

class Bar(models.Model):
    title = models.CharField(max_length=128)
    foo = models.ForeignKey(Foo)

    class Meta:
        verbose_name = ""Bar""
        verbose_name_plural = ""Bars""

    def __str__(self):
        return self.title

}}}

{{{
admin.py

from django.contrib import admin
from django import forms
from . import models

class BarInlineForm(forms.ModelForm):
    title = forms.CharField(max_length=128)
 
    class Meta:
        model = models.Bar
        fields = ('title',)
 
class BarInline(admin.TabularInline):
    model = models.Bar
    form = BarInlineForm
    extra = 3

class FooAdmin(admin.ModelAdmin):
    inlines = [BarInline]

admin.site.register(models.Foo, FooAdmin)
}}}

"	Bug	closed	contrib.admin	1.8	Normal	fixed	TabularInline		Accepted	1	0	0	0	0	0
