> Collin Anderson:
> I think this is a good idea. Django has used __html__ internally for the last 
> 4 years so it's not something new [0]. I'm surprised this doesn't work 
> out-of-the box.


I too expected this to work already, and I was surprised to find it doesn’t. 
Hence this thread. (It also surprises me that this hasn’t been discussed on 
this list before, to be honest.)

> Brice Parent:
> I like the idea a lot. But wouldn't it be better to have it as a separate 
> library? It seems to be something that could be quite common, and have many 
> use cases both inside and outside Django (we could sometimes benefit from 
> having an html exception message for example). 
> 

As you have correctly observed this can’t live in a separate library entirely 
as it requires integration into the template language to be useful:
> Django's template would call this html() function in its templates, while 
> models and other objects could just declare this __html__() method.

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/99A37EDD-250A-45D3-A1FF-F4E429B5EFB5%40lophus.org.
For more options, visit https://groups.google.com/d/optout.

Reply via email to