Re: Annotate and Subquery with 2 tables in 2 different databases

2023-04-20 Thread Jason
this won't work, you're doing things across two entire dbs. So you'l have to implement all the logic in python to execute. On Thursday, April 20, 2023 at 9:58:20 AM UTC-4 Mạnh ĐỖ wrote: > I want to use annotate and subquery to join tables. > Table1 in database1 and table2 in database2. But

Re: Async views means dropping gunicorn gevent for uvicorn, affecting sync view performance

2023-04-20 Thread awe...@foxmail.com
I think you may split the async endpoints and the sync endpoints into two different procress group and start them in different ways( different start up command, worker and different port). And config the Load Balancer (Nginx?) to point to different ports by path.. I would handle the migration

Annotate and Subquery with 2 tables in 2 different databases

2023-04-20 Thread Mạnh ĐỖ
I want to use annotate and subquery to join tables. Table1 in database1 and table2 in database2. But it's not work. I got the error: QuerySet.annotate() received non-expression(s): database1. the code here: from django.db.models import Subquery, OuterRef, Count from app1.models import Table1