Opened 16 years ago

Closed 16 years ago

Last modified 13 years ago

#8338 closed (worksforme)

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

Reported by: Wojciech Bartosiak Owned by: nobody
Component: Template system Version: dev
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: no UI/UX: no

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 Wojciech Bartosiak 16 years ago.
Scrrenshot in admin panel
ss01-t8338.png (20.1 KB ) - added by Ramiro Morales 16 years ago.
ss02-t8338.png (21.2 KB ) - added by Ramiro Morales 16 years ago.

Download all attachments as: .zip

Change History (7)

by Wojciech Bartosiak, 16 years ago

Attachment: zrzutekranu.png added

Scrrenshot in admin panel

comment:1 by anonymous, 16 years ago

milestone: 1.0 beta1.0

comment:2 by Wojciech Bartosiak, 16 years ago

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

comment:3 by Ramiro Morales, 16 years ago

Resolution: worksforme
Status: newclosed

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

by Ramiro Morales, 16 years ago

Attachment: ss01-t8338.png added

by Ramiro Morales, 16 years ago

Attachment: ss02-t8338.png added

comment:4 by Jacob, 13 years ago

milestone: 1.0

Milestone 1.0 deleted

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