﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
32467	django admin widget.attrs not work with ForeignKey	Hassan Igbaria	Hassan Igbaria	"{{{ self.fields['parent'].widget.attrs = {'class': 'custom-class'} }}}

parent is ForeignKey field

{{{

class Category(models.Model):
    title = models.CharField(_('Title'), max_length=300)
    description = models.TextField(_('Description'), null=True, blank=True)
    is_active = models.BooleanField(_('Active ?'), default=True)
    image = models.ImageField(
        _('Image'), upload_to=""category/"", null=True, blank=True
        )
    parent = models.ForeignKey(
        ""self"", verbose_name=_('Parent'), on_delete=models.SET_NULL,
        null=True, blank=True
        )

}}}
"	Cleanup/optimization	assigned	Forms	3.1	Normal				Unreviewed	0	0	0	0	0	0
