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:
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:
>
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("")
>
>
>
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) ->
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
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
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
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':
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.
>
>
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일 일요일 오전
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
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
12 matches
Mail list logo