[Django] #24976: admin.TabularInline custom form field header displaying as None on admin page

25 views
Skip to first unread message

Django

unread,
Jun 12, 2015, 10:01:44 AM6/12/15
to django-...@googlegroups.com
#24976: admin.TabularInline custom form field header displaying as None on admin
page
-------------------------------+---------------------------
Reporter: kartikanand | Owner: nobody
Type: Bug | Status: new
Component: contrib.admin | Version: 1.8
Severity: Normal | Keywords: TabularInline
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------+---------------------------
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)
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/24976>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Jun 12, 2015, 10:01:58 AM6/12/15
to django-...@googlegroups.com
#24976: admin.TabularInline custom form field header displaying as None on admin
page
---------------------------+----------------------------

Reporter: kartikanand | Owner: nobody
Type: Bug | Status: new
Component: contrib.admin | Version: 1.8
Severity: Normal | Resolution:

Keywords: TabularInline | Triage Stage: Unreviewed
Has patch: 0 | Easy pickings: 1
UI/UX: 0 |
---------------------------+----------------------------
Changes (by kartikanand):

* Attachment "Screenshot from 2015-06-12 19:29:22.png" added.

Screenshot of admin page

Django

unread,
Jun 13, 2015, 3:15:03 PM6/13/15
to django-...@googlegroups.com
#24976: admin.TabularInline custom form field header displaying as None on admin
page
-------------------------------+------------------------------------

Reporter: kartikanand | Owner: nobody
Type: Bug | Status: new
Component: contrib.admin | Version: 1.8
Severity: Normal | Resolution:
Keywords: TabularInline | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+------------------------------------
Changes (by timgraham):

* needs_better_patch: => 0
* stage: Unreviewed => Accepted
* easy: 1 => 0
* needs_tests: => 0
* needs_docs: => 0


--
Ticket URL: <https://code.djangoproject.com/ticket/24976#comment:1>

Django

unread,
Oct 4, 2015, 10:08:56 PM10/4/15
to django-...@googlegroups.com
#24976: admin.TabularInline custom form field header displaying as None on admin
page
-------------------------------+------------------------------------
Reporter: kartikanand | Owner: matiasb
Type: Bug | Status: assigned
Component: contrib.admin | Version: 1.8

Severity: Normal | Resolution:
Keywords: TabularInline | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+------------------------------------
Changes (by matiasb):

* owner: nobody => matiasb
* status: new => assigned


--
Ticket URL: <https://code.djangoproject.com/ticket/24976#comment:2>

Django

unread,
Oct 6, 2015, 7:16:59 PM10/6/15
to django-...@googlegroups.com
#24976: admin.TabularInline custom form field header displaying as None on admin
page
-------------------------------+------------------------------------
Reporter: kartikanand | Owner: matiasb
Type: Bug | Status: assigned
Component: contrib.admin | Version: 1.8

Severity: Normal | Resolution:
Keywords: TabularInline | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+------------------------------------
Changes (by matiasb):

* has_patch: 0 => 1


Comment:

Pull request created: https://github.com/django/django/pull/5403
All tests passing for SQLite.

--
Ticket URL: <https://code.djangoproject.com/ticket/24976#comment:3>

Django

unread,
Oct 21, 2015, 1:37:20 PM10/21/15
to django-...@googlegroups.com
#24976: admin.TabularInline custom form field header displaying as None on admin
page
-------------------------------+------------------------------------
Reporter: kartikanand | Owner: matiasb
Type: Bug | Status: closed
Component: contrib.admin | Version: 1.8
Severity: Normal | Resolution: fixed

Keywords: TabularInline | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+------------------------------------
Changes (by Tim Graham <timograham@…>):

* status: assigned => closed
* resolution: => fixed


Comment:

In [changeset:"12aeed8c949925488a36f0a3b3bf25dfc9407cbf" 12aeed8]:
{{{
#!CommitTicketReference repository=""
revision="12aeed8c949925488a36f0a3b3bf25dfc9407cbf"
Fixed #24976 -- Fixed missing form label in tabular inline.

If the model form had a form field specified, the label rendered
as "None".
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/24976#comment:4>

Reply all
Reply to author
Forward
0 new messages