Re: Adding custom join support to Django

2019-11-28 Thread Alexandr Artemyev
I tried to describe my case with custom joins in django issue tracker.
I hope that I described it quite clearly. And that was helpful.
I would especially like to note that 
https://stackoverflow.com/questions/22902263/django-orm-joining-subquery/42816689#42816689
 
this solution completely suited me.

среда, 28 марта 2018 г., 10:54:06 UTC+3 пользователь Josh Smeaton написал:
>
> Someone has again brought up the lack of custom join support in django - 
> specifically LEFT OUTER joins: https://code.djangoproject.com/ticket/29262
>
> I figure it's probably something that we'd like the ORM to support but I 
> don't think we've ever really landed on a design that's palatable. I'd like 
> to try and get a rough consensus for a design and flesh out any likely 
> issues. We can then either provide a ready to go syntax that someone could 
> implement, or I could put together a DEP. At a minimum, we can point future 
> askers towards a design and "PR Welcome" them. Best case someone (possibly 
> myself) runs with the design and provides an implementation.
>
> What I'm interested in seeing are specific use cases for customising joins 
> as that will drive any kind of design.
>
> I've been playing around with some syntaxes, and this is the kind of thing 
> I'm currently leaning toward:
>
> qs = Book.objects.annotate(
> my_reviews=joins.Left(
> Review.objects.filter(user=u1),
> book=OuterRef('pk')
> )
> )
>
> This supports customising both the join type, and the join conditions (ON 
> book.id = review.book_id). One concern with this design is that now the 
> result set contains multivalues - where a book might be repeated if the 
> number of reviews that match the filter is greater than 1. We could ask the 
> user to specify whether the result is potentially multi-valued and convert 
> the result into a list, but that would require ordering and comparing the 
> current row to the previous row to check if it's a multivalue. These are 
> the kind of issues I want to flesh out, and that's only going to be 
> possible given a sufficient corpus of examples.
>
> So I'll kick off with an example that seems to be rather common:
>
> *- Add filtered results from a reverse relation / m2m relation to the 
> result set without eliminating results using a LEFT JOIN.*
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/1a556e51-f257-4d7f-b174-06d9fa66a721%40googlegroups.com.


Re: New to Open Source Contribution Need Help With Setting Up Environment For Channels to Reproduce Issues After Cloning From Git

2019-11-28 Thread Adam Johnson
Hi Suvodeep,

Did you see this documentation page?
https://channels.readthedocs.io/en/latest/contributing.html

If you use the command:

pip install -e .

You can install your cloned channels copy in a virtual environment and use
that as normal in a channels app.

Afraid I haven't worked on it myself but the instructions seem pretty
complete. I don't think there are many people working on Channels itself
right now though.

Thanks,

Adam

On Tue, 5 Nov 2019 at 05:49, Suvodeep Dubey  wrote:

> I have cloned channels repo in my local. I was going through the bugs but
> was unable to set-up the environment to reproduce the bugs.
>
> I have the following understanding:
>
> 1. Rather than `pip install channels` clone the channels from git
> 2. Execute the channels parallel to your application and make them talk
> and see the errors in application and logs in channels.
>
> I am unable to build and run the channels and configure it with a dummy
> Django app to reproduce the bugs.
>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-developers/ddd5f084-7797-471d-889f-456c83df8b28%40googlegroups.com
> 
> .
>


-- 
Adam

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/CAMyDDM2UNk3vZU2dUBmEo5C7cH%2B57fzP_PdiNfSDZUXDS%2B9UDg%40mail.gmail.com.