Opened 7 years ago

Closed 7 years ago

Last modified 3 years ago

#8338 closed (worksforme)

Admin panel generating HTML table without <input> fields if variable contains "_A" string

Reported by: bartosak Owned by: nobody
Component: Template system Version: master
Severity: Keywords: no input fields html admin panel
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

Main information

Admin panel generating HTML table to enter data.
But if object contains '_' char and after that is letter 'A'
( for example: 'Foo_Address' )
adv_forms don't creates fields ( INPUT field in HTML)

Django version

Django ver: SVN-checkout: rev.8365

# -*- coding: utf-8 -*-

from django.db import models
from django.contrib import admin
from django.utils.translation import ugettext as _


class Foo(models.Model):
    foo = models.CharField(verbose_name=_('FOO'), max_length=11)

class Foo_Address(models.Model):
    foo = models.ForeignKey(Foo)
    bar = models.CharField(max_length=11)

class Foo_Faddress(models.Model):
    foo = models.ForeignKey(Foo)
    bar = models.CharField(max_length=11)

class Foo_Address_Inline(admin.TabularInline):
    model = Foo_Address
    extra = 1

class Foo_Faddress_Inline(admin.TabularInline):
    model = Foo_Faddress
    extra = 1

class Foo_Admin(admin.ModelAdmin):
    inlines = [Foo_Address_Inline, Foo_Faddress_Inline]



admin.site.register(Foo, Foo_Admin)

Screenshot

Attachments (3)

zrzutekranu.png (21.4 KB) - added by bartosak 7 years ago.
Scrrenshot in admin panel
ss01-t8338.png (20.1 KB) - added by ramiro 7 years ago.
ss02-t8338.png (21.2 KB) - added by ramiro 7 years ago.

Download all attachments as: .zip

Change History (7)

Changed 7 years ago by bartosak

Scrrenshot in admin panel

comment:1 Changed 7 years ago by anonymous

  • milestone changed from 1.0 beta to 1.0
  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

comment:2 Changed 7 years ago by bartosak

  • Summary changed from Admin panel generating HTML table without <input> fields to Admin panel generating HTML table without <input> fields if variable contains "_A" string

comment:3 Changed 7 years ago by ramiro

  • Resolution set to worksforme
  • Status changed from new to closed

I can't reproduce this using r8427. Tested with both en-us and es-ar Django localizations (see attached screenshots) and using the same exact models.py file you posted (no admin.py was used).

Unrelated note: You might want to replace ugettext with ugettext_lazy as per http://www.djangoproject.com/documentation/i18n/#lazy-translation

Changed 7 years ago by ramiro

Changed 7 years ago by ramiro

comment:4 Changed 3 years ago by jacob

  • milestone 1.0 deleted

Milestone 1.0 deleted

Note: See TracTickets for help on using tickets.
Back to Top