#34383 closed Bug (fixed)
Layout error in Admin when using help_text
Reported by: | Antonio Candido Nazareth junior | Owned by: | Tom Carrick |
---|---|---|---|
Component: | Template system | Version: | 4.2 |
Severity: | Release blocker | Keywords: | help_text |
Cc: | Tom Carrick | Triage Stage: | Ready for checkin |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description (last modified by )
I'm using Django 4.2b1 and found a problem with the Django admin layout when I use the help_text in model admin. The help_text in the Admin form appears on a separate line and breaks the alignment of the fields. This happens in every browser I've tested.
Create a model with two or more fields that have help_text defined with a size larger than the field name. Register this model in admin.py with ModelAdmin and put them on the same line using fieldsets giving name to the line. Access the edit page of this model in Django admin and observe the layout.
Expected result:
The help_text should appear below the corresponding field, without affecting the alignment of the other fields.
Attachments (3)
Change History (14)
by , 22 months ago
comment:1 by , 22 months ago
Description: | modified (diff) |
---|
comment:2 by , 22 months ago
Resolution: | → needsinfo |
---|---|
Status: | new → closed |
Hi, I don't think you've explained the issue in enough detail to confirm a bug in Django. Do you have any custom templates? Please reopen the ticket if you can debug your issue and provide a sample minimal project that reproduces it.
by , 21 months ago
Error breaking line with two or more columns with help_text
comment:3 by , 21 months ago
Resolution: | needsinfo |
---|---|
Status: | closed → new |
Steps to reproduce the error:
Create model new:
app.new.models.py
from django.db import models class Favi(models.Model): faviNumero = models.CharField(max_length=20,help_text='Data incluindo o Horário do término da viagem') matricula1 = models.CharField(max_length=50,help_text='Data incluindo o Horário do término da viagem') matricula3 = models.CharField(max_length=50,help_text='Data incluindo o Horário do término da viagem') matricula2 = models.CharField(max_length=50,help_text='Data incluindo o Horário do término da viagem') matricula = models.CharField(max_length=50,help_text='Data incluindo o Horário do término da viagem') objetivo = models.TextField(verbose_name='Objetivo', help_text='DESCRIÇÃO OBJETIVA DO SERVIÇO A SER EXECUTADO') periodoInicio = models.DateTimeField(verbose_name='Início',help_text='Data incluindo o Horário de início da viagem') periodoTermino = models.DateTimeField(verbose_name='Término',help_text='Data incluindo o Horário do término da viagem')
app.new.admin.py
from django.contrib import admin from new.models import Favi # Register your models here. class FilterFaviAdmin(admin.ModelAdmin): fieldsets = [ (None, {'fields':[('faviNumero','matricula1','matricula3'),'objetivo',('periodoInicio','periodoTermino'),('matricula2','matricula',),]}), ] admin.site.register(Favi,FilterFaviAdmin)
Result appears broken layout with help text as image below installed django pre version 4.2b1
comment:4 by , 21 months ago
Cc: | added |
---|---|
Severity: | Normal → Release blocker |
Triage Stage: | Unreviewed → Accepted |
Thanks for details!
Regression in 96a598356a9ea8c2c05b22cadc12e256a3b295fd.
comment:5 by , 21 months ago
I tried to fix this, it's much better (but not perfect, you can see minor issues on the "Change user" view) with the following diff.
[REMOVED as can be confusing]
comment:6 by , 21 months ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
Print erro on Django Version 4.2b1