Re: Subquery join support

2020-04-15 Thread Andre Terra
Thanks, Alexandr, for your effort in addressing what I personally consider a much needed feature in the ORM. I gave your PR a try and noticed that evaluating the same Product.objects.annotate line below twice in a row returns two different SQL queries, the second of which results in an error.

Re: Swappable sessions

2020-04-15 Thread Tim Graham
I don't see a strong argument for adding it. As far as I can tell, this would require adding 'request' to the signature of SessionStore.__init___() (so it could be stored as an attribute on SessionStore and thereby available in create_model_instance()). Backwards compatibility would be

Re: Swappable sessions

2020-04-15 Thread Lorenzo Peña
Yes, of course. I am already working things around in order to get what I need. Now, the database backed SessionStore defines a method "create_model_instance(self, data)" which is called from "django.contrib.sessions.middleware.SessionMiddleware". Django docs invite to redefine this method in

Re: Swappable sessions

2020-04-15 Thread Lorenzo Peña
Yes, of course. I am already working things around in order to get what I need. Now, the database backed SessionStore defines a method "create_model_instance(self, data)" which is called from "django.contrib.sessions.middleware.SessionMiddleware". Django docs invite to redefine this method in

Re: Swappable sessions

2020-04-15 Thread Tim Graham
Can't you copy whatever data you want from the request into the session data (request.session. = request.) in a view, middleware, or wherever? That seems like the proper separation of concerns. On Wednesday, April 15, 2020 at 11:50:13 AM UTC-4, Lorenzo Peña wrote: > > Now, in order to follow

Re: Generate JWTs with Django

2020-04-15 Thread Claude Paroz
Thanks Abhijeet for the pointer, I know there are some rather complete JWT libs around, but my proposal is not about a complete package to manage JWT in general. It's rather some low level ability for Django to produce and decode simple HS256 JWT. Then other third-party libs could build on that

Re: Generate JWTs with Django

2020-04-15 Thread Abhijeet Viswa
Hi, You might want check out django-restframework-simplejwt. It requires the Django Rest Framework. But, then again, if you are making an API, you'd already be using it. Regards, Abhijeet On Thu, 16 Apr, 2020, 00:39 Claude Paroz, wrote: > Hi all, > > With the recent addition of the algorithm

Generate JWTs with Django

2020-04-15 Thread Claude Paroz
Hi all, With the recent addition of the algorithm parameter to the signing.Signer class, it's now rather straightforward for Django to generate HS256 (non-encrypted) JSON Web Tokens. With a growing popularity of JS-client/Django server communications (DRF and al.), I think there might be some

Re: Swappable sessions

2020-04-15 Thread Lorenzo Peña
Now, in order to follow the path suggested in the Django documentation for overriding database backed sessions, some of the data one might need to store in the session model is coming from the request, and Django is not passing the request when instantiating the session store. Do you think

Re: Subquery join support

2020-04-15 Thread Alexandr Tatarinov
This has not received a lot of feedback so far, so I think some code can help. I am not sure what is the next steps; as I've understood, we need some kind of consensus to open a ticket. Please, don't hesitate to express your opinion on the feature and the API, as well as the implementation to

Re: Making the admin more navigable

2020-04-15 Thread Carlton Gibson
Do we know anyone who's a *Design/CSS/UX specialist* that can offer some input here? Hi Tom. Thanks for this PR. https://github.com/django/django/pull/12159 I think it's a good addition. It's perhaps not perfect, but we can take it as an incremental change and then improve it over time.