Putting HTML for the admin in model definitions is a bit too coupled.
I think you may be able to add icons already by overriding the admin
template - can you try playing around with that?
On Mon, Feb 6, 2023 at 12:07 AM Yeonggwang Yang
wrote:
> that sounds good with me
>
> 2023년 2월 5일 일요일 오전 9시
I too find the idea of hard coded HTML in a Python file to be inelegant,
for what it's worth.
Arthur Pemberton
On Sat, 18 Feb 2023 at 08:12, 'Adam Johnson' via Django developers
(Contributions to Django itself) wrote:
> Putting HTML for the admin in model definitions is a bit too coupled.
>
> I
Yeah, I've tried to create templatetag like this:
@register.simple_tag
def get_module_icon(model, app):
if app == 'auth':
if model == 'Groups':
return ''
elif model == 'Users':
return ''
elif app == 'core':
elif model == 'Generations':