Re: Model icons

2023-06-02 Thread Thibaud Colas
Hi all, I see Wagtail has been mentioned, we actually shipped a lot of improvements to our icons support in our last release, thought Iโ€™d share a few details in case it helps in considering this for Django. Here is Wagtailโ€™s documentation for custom icons: https://docs.wagtail.org/en/stable/adv

Re: Model icons

2023-03-03 Thread Bogdan Barna
Hello all, I've joined this emailing list just to support the fellow users, of not adding this (especially on models.Model) as per their points made. Thanks, Bogdan On Thursday, February 23, 2023 at 5:54:44โ€ฏPM UTC+2 Jacob Rief wrote: > On Thu, Feb 23, 2023 at 7:38 AM Brice Parent wrote: > >>

Re: Model icons

2023-02-23 Thread Jacob Rief
On Thu, Feb 23, 2023 at 7:38 AM Brice Parent wrote: > Hello! > > Really useful idea, I think! 2 points about it: > > 1. Syntax > > I would also remove the html from the models, but probably in this way: > class Hammer(models.Model): > ... > > Meta: > icon = ModelIcon("๐Ÿ”จ") > > > Th

Re: Model icons

2023-02-22 Thread Brice Parent
Hello! Really useful idea, I think! 2 points about it: 1. Syntax I would also remove the html from the models, but probably in this way: class Hammer(models.Model): ย  ย  ... ย  ย  Meta: ย  ย  ย  ย  icon = ModelIcon("๐Ÿ”จ") There would be something like ModelIcon.as_html(self, model_name:str) -> str:

Re: Model icons

2023-02-20 Thread Marty
I really like the idea to add just a simple 'icon' attribute. That's quite elegant solution. Thanks, Mark! ๐Ÿ™‚ On Monday, February 20, 2023 at 2:33:43 PM UTC+1 Jacob Rief wrote: > I agree with Adam Johnson that adding HTML to the model class is a bit too > coupled. > But I like the idea of Mark N

Re: Model icons

2023-02-20 Thread Jacob Rief
I agree with Adam Johnson that adding HTML to the model class is a bit too coupled. But I like the idea of Mark Niehues to add them to the ModelAdmin class, although I would allow a HTML/SVG snippet rather than a CSS class. - How would we then handle 3rd party apps providing their own SVG fil

Re: Model icons

2023-02-19 Thread Mark Niehues
If we are talking only about icons in Django Admin: Wagtail (a CMS based on Django) solves it for their custom Admin Views in a similar way to your proposed Meta attribute [0]. The analog solution for django admin would be, that the ModelAdmin gets an 'icon' attribute, which does not contain t

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':

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 '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-05 Thread Yeonggwang Yang
that sounds good with me 2023๋…„ 2์›” 5์ผ ์ผ์š”์ผ ์˜ค์ „ 9์‹œ 36๋ถ„ 17์ดˆ UTC+9์— Marty๋‹˜์ด ์ž‘์„ฑ: > Hi all, > > Recently, it's trend to use icons or emoji before menu items and I like > this idea because IMHO people orient better and more quickly when they see > picture. > > What about to add this feature to native d

Model icons

2023-02-04 Thread Marty
Hi all, Recently, it's trend to use icons or emoji before menu items and I like this idea because IMHO people orient better and more quickly when they see picture. What about to add this feature to native django? I thought the easiest way would be to add new Meta option to Model. The default