Re: models.CalculatedField feature

2017-11-20 Thread ilya . kazakevich
Thank you all. I've created a feature request https://code.djangoproject.com/ticket/28822 and will try to implement in my Django fork next week. I am not Django source code guru, so any help is welcome:) -- You received this message because you are subscribed to the Google Groups "Django deve

Re: models.CalculatedField feature

2017-11-19 Thread ilya . kazakevich
Ok, can we have is_adult = models.DBCalculatedField(ExpressionWrapper(Q(age__gt=18), output_field=BooleanField())) Any query for model with this field will be automatically annotated with .annotate(is_adult =ExpressionWrapper(Q(age__gt=18), output_field=BooleanField())) We may use F fields a

Re: models.CalculatedField feature

2017-11-19 Thread ilya . kazakevich
Ok, I see not everyone are happy with idea of ORM expression calculated on Python side:) We can: * Provide two different backends (Database-based and Python-based or "run python in database" backend) for calculated field * Or provide python-based backend as third party lib * Or provide whole so

Re: [off topic] Re: models.CalculatedField feature

2017-11-18 Thread ilya . kazakevich
> > Such computations always end up slightly different in some > edge cases > I agree. We can document this fact. Model authors should be aware that they are not allowed to use anything but literals. All other functions are used on their own risc. I believe that comparition of two integers or

Re: models.CalculatedField feature

2017-11-16 Thread ilya . kazakevich
Thank you for your intereset this on feature. I belive this functionality should not delegete everything to database: one of the cooliest Django features is that models do not require database: they could be just storage of *business* logic (that is why we call them *fat*). I can even fill my mo

models.CalculatedField feature

2017-11-15 Thread ilya . kazakevich
ld be supported by Django core because it affects admin, forms (calculated fields can't be changed), migrations and ORM. *Ilya Kazakevich* PyCharm developer. http://www.jetbrains.com The Drive to Develop -- You received this message because you are subscribed to the Google Groups &quo

Re: Suggestion: add default "registration/login.html" to django.contrib.auth

2015-03-03 Thread Ilya Kazakevich
So, should I create a ticket? On Tuesday, March 3, 2015 at 4:05:01 PM UTC+3, Ilya Kazakevich wrote: > > Hello, > > When I use Django auth, I need to provide login.html myself. But Django > encourages applications to have default templates which can be overwritten

Re: Suggestion: add default "registration/login.html" to django.contrib.auth

2015-03-03 Thread Ilya Kazakevich
read the docs" > > I'd perhaps be inclined to include it without styles even. > > Marc > > On 3 March 2015 at 14:22, Ilya Kazakevich > wrote: > >> I do not think admin templates should used. But something very simple and >> dumb (that looks similar to

Re: Suggestion: add default "registration/login.html" to django.contrib.auth

2015-03-03 Thread Ilya Kazakevich
t; On Tuesday, March 3, 2015 at 8:18:39 AM UTC-5, Tino de Bruijn wrote: >> >> Yeah, or default to admin/login.html. The admin ships with all necessary >> "registration" templates, but for some reason only the login.html is >> included in the admin directory. >> >&

Suggestion: add default "registration/login.html" to django.contrib.auth

2015-03-03 Thread Ilya Kazakevich
Hello, When I use Django auth, I need to provide login.html myself. But Django encourages applications to have default templates which can be overwritten by user (via filesystem.Loader, for example). I suggest to provide default login.html with simple HTML form. User may always overwrite it.

"stable API" misconception giving BaseManager and Manager as examples

2014-12-27 Thread Ilya Kazakevich
Hello, In Djnago 1.7 Manager class extends BaseManager (actually, it extends its proxy, created using from_queryset). BaseManager is not mentioned in official documentation, so it is not part of official ("stable") api, right? "All the public APIs (everything in this documentation) " (from here