#28788: Add support for Model.clean_

2017-11-09 Thread Jonas Haag
Hi, I’m taking https://code.djangoproject.com/ticket/28788 to this mailing as per Tim’s request. I’m convinced we should add a Model.clean_ method, the model equivalent to Form.clean_. Form validation has forms.Field.validators, Form.clean, and

Automatically redirecting to language URL

2017-10-26 Thread Jonas Haag
Hi! Scenario: You have translated URLs, e.g. /pricing and /preise (German). Someone visiting your page in one language copies a page’s URL (e.g. /preise) and sends it to their friend, who uses a different language. The friend will get a 404 because their language’s URL translation (e.g.

Re: Templates: __html__ method support

2017-09-26 Thread Jonas Haag
> Am 26.09.2017 um 22:50 schrieb Aymeric Augustin > : > > Hello, > > This could be a regression because > https://github.com/django/django/commit/3483682749577b4b5a8141a766489d5b460e30e9 > >

Re: Templates: __html__ method support

2017-09-26 Thread Jonas Haag
> Aymeric Augustin: > >> On 26 Sep 2017, at 22:56, Jonas Haag <jo...@lophus.org >> <mailto:jo...@lophus.org>> wrote: >> >> Without having had a look at any of the links you’ve posted, this does NOT >> work in Jinja2 the way I suggested: &g

Re: Templates: __html__ method support

2017-09-26 Thread Jonas Haag
> Aymeric Augustin: > This could be a regression Without having had a look at any of the links you’ve posted, this does NOT work in Jinja2 the way I suggested: >>> jinja2.Template('{{foo}}').render({'foo': Money('1', '$')}) '$ 1' So whatever the changes for better __html__ interoperability

Re: Templates: __html__ method support

2017-09-26 Thread Jonas Haag
> 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

Re: Order of models metaclass __new__ dict

2009-01-12 Thread Jonas Haag
Honza Král wrote: > use Field.creation_counter instead of self.__class__ Oh, yeah. Thank you, it works :-) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django developers" group. To post to this group, send email

Re: Order of models metaclass __new__ dict

2009-01-12 Thread Jonas Haag
Alex Koshelev wrote: > I can write a short overview: >Each model field(or form field) is marked by special counter while > model(or form) is loading. Then in metaclass fields are sorted by that > counter. > > I've recently written the blog post about this staff but its in > Russian language.