Hi, I have just implemented Table Function support on Django 2.1. What do you think about adopting it into Django itself?
-- It is all about passing function parameters into BaseTable and Join classes https://github.com/django/django/blob/master/django/db/models/sql/datastructures.py Here are other thoughts which were inspiring me https://schinckel.net/2019/10/31/functions-as-tables-in-django-and-postgres/ Thanks, Petr 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 [hidden email]. To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/6d16fdfc-332f-4a72-83ae-04ee5c9fd28a%40googlegroups.com. |
I'm not an expert or even an amateur at the ORM, but here are my thoughts on the matter: 1. Does it carry over well across the four databases?3. What specific use case will benefit from adopting this idea? I ask the second question because it seems from your gist that you don't need your proposal to be part of core for it to work. It seems it would work completely well and flourish even as a third-party app given how you're subclassing the API and expanding on its usage. Contrast this with django-pytest for example that can have a harder problem running pytest on Django due to how the test runner is currently built (namely that setup assumes a subclass of the Django test runner).Regards, Ahmad On Sun, May 17, 2020 at 4:36 PM Petr Přikryl <[hidden email]> wrote:
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 [hidden email]. To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/CAJNa-uPBFBhOyrMB9X97wVU12Hk6%2Bn7Jy8qSXhZr6-jGn9mOsQ%40mail.gmail.com. |
ad 1. I was testing it on PostgreSQL only. But:
--
ad 2. Yes, "it is necessary". Because I must do some nasty hacks in my gist. For example:
ad 3. The use case is optimization for me. Because I had SQL View with recursion. The View was mapped into Django through model. But operations with this view takes long time for my app. So I found out that I can optimize that using table function instead view with parameter limiting the recursion depth. But I couldn't switch view to table function because no ORM support. With this gist I could. ad tests. I used them because I am used to use them :-). And I think that it should be re-writable to classic Django tests. Petr Dne neděle 17. května 2020 23:08:08 UTC+2 Ahmad A. Hussein napsal(a):
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 [hidden email]. To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/ae02ee22-d858-4dd2-ae56-b219e53305d1%40googlegroups.com. |
Concerning tests, I did not mean to comment about the tests you wrote. I
used the third party py-test django app as an example of an app that
does need work in core to function better, not as a comment about your
usage of tests. You're more than free to work the way you want to :) (I
like pytest too)
-- If there's an optimization to be had in including table functions and it'll be backwards compatible without breaking anything, then I think there's merit in the idea. I suggest you open a ticket on the issue tracker and mention how significant the optimization was. It'll help with getting this new feature adopted. On Monday, May 18, 2020 at 8:31:04 AM UTC+2, Petr Přikryl wrote:
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 [hidden email]. To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/9c66df8e-237f-43fe-8a7b-e518a1288001%40googlegroups.com. |
Linking the issue https://code.djangoproject.com/ticket/31609
-- Dne pondělí 18. května 2020 13:57:49 UTC+2 Ahmad A. Hussein napsal(a):
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 [hidden email]. To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/38376f17-135c-4ea9-9e86-6f9e07c609ec%40googlegroups.com. |
Free forum by Nabble | Edit this page |