Sunday, November 22, 2015

Re: How to wrap text on Django admin columns with long text?

See this documentation page

https://docs.djangoproject.com/en/1.8/ref/contrib/admin/#django.contrib.admin.ModelAdmin.list_display

Or try to use:


this way:

import easy
from django.contrib import admin from django.template.defaultfilters import linebreaksbr class YourAdmin(admin.ModelAdmin):
    list_display = ('...', 'wrapped_field')

wrapped_field= easy.SimpleAdminField(lambda x: linebreaksbr(x.field_name), 'field_name', 'field_name')



On Sun, Nov 22, 2015 at 6:44 PM, Jorge Fernandez-de-Cossio-Diaz <j.cossio.diaz@gmail.com> wrote:
In Django's admin interface, on the table displaying all the items in my database, sometimes a column gets too big, because an item has a long line of text at this field. This looks ugly and makes the table hard to use. I want to fix this by automatically adding line breaks (that is, wrapping long lines) after a given maximum of characters. Is there an easy way to do this?

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/01871e6a-fefe-447f-a38f-5a9fc1f1c82c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Ezequiel Bertti
E-Mail: ebertti@gmail.com
Cel: (21) 99188-4860

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CACrQMYpocme0GPLxNfBfq8zPiZ2axwxqMXd61nrV%2B02LPobzOA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment