What is the problem you are trying to solve?
What do you want to optimize exactly? 🤔
hope this course helps you : https://acciojob.com/
On Monday, June 28, 2021 at 7:36:38 AM UTC+5:30 David Nugent wrote:
> Well, one workaround that may serve if your dataset isn't too large is to
> use a cache
Well, one workaround that may serve if your dataset isn't too large is to
use a cache (or dict) and pre-load it.
Unlike the db, caches tend to be more async friendly, unless of course your
cache is in your db :-)
This just needs to be pre-loaded on startup (.apps.:.ready() is a good spot for
Thanks for the explanation!
To get it working, I will replace my model converters with basic converters
and do corresponding lookups in the views.
On Sunday, 20 June 2021 at 16:16:58 UTC-7 Andrew Godwin wrote:
> Ah yes, that's because the URL parsing/conversion all happens in the main
> (async
Ah yes, that's because the URL parsing/conversion all happens in the main
(async, in ASGI mode) thread - and because to_python is a a synchronous
function interface, there is literally nothing you can do to make it work.
The only real way of fixing this would be for Django to patch the URL
conv
I'm trying to switch from WSGI to ASGI and I'm having issues with my model
id to model converters.
I define my converters like this
def to_python(self, primary_key):
try:
return self.model.objects.get(pk=primary_key)
except self.model.DoesNotExist:
raise ValueError
W
in the main urls.py file (which is usually in
>> the main project name, alongside settings.py). That's all you need to do.
>>
>> I don't know about the slug converter though - I would just reregister it
>> and see what happens :)
>>
>> Regards,
>>
&
t reregister it
> and see what happens :)
>
> Regards,
>
> Andréas
>
>
> Den ons 6 maj 2020 kl 11:23 skrev אורי :
>
>> Hi,
>>
>> Do I have to use register_converter in any file using it? I have a
>> project with many urls.py files, and I want to
2020 kl 11:23 skrev אורי :
> Hi,
>
> Do I have to use register_converter in any file using it? I have a project
> with many urls.py files, and I want to register converters which will be
> used in multiple files. How do I register them? Do I have to register them
> in all the
Hi,
Do I have to use register_converter in any file using it? I have a project
with many urls.py files, and I want to register converters which will be
used in multiple files. How do I register them? Do I have to register them
in all the urls.py files? And where in my project should I put the
9 matches
Mail list logo