Re: Model icons

2023-02-18 Thread 'Adam Johnson' via Django developers (Contributions to Django itself)
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시

Re: Model icons

2023-02-18 Thread Arthur Pemberton
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

Re: Model icons

2023-02-18 Thread Marty
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':