Yep it works in the sense of “mimic”-ing the supposed async orm, so I don’t need to type sync_to_async every line, and since it uses threads, it won’t be firing asyncio at full power sadly.
Speaking of the nomenclature. Altho the functionality is what matters for most, but I also care if the code “look good” or not (maybe it’s a me thing, no wonder I can spend 1 hour naming just 1 method) The rating from best to worse for me is:
-
Model.aobjects.get()but that may implies the need of 2 model managers which might not be backward compatible at all. EDIT: even if usingagetthe need to overrideagetis still needed, either of these options will require overriding the async method to make it work. So this may be the best option imo. -
Model.objects.aget()should have good backward compatibility, and the least annoying out of all the prefix and suffix out there, which looks a little uglier onaall()andacount(). -
Model.objects.a.get()should be okay aswell, but I would prefer that all the methods (sync and async ones) are in the same level, hence no dots (.). -
Model.objects.async_get()Kinda long and ugly. -
Model.objects.get_async()Maybe uglier.
Will look forward the results of it tho. Is it realistic to expect the async ORM to come in 4.0 or 4.1 ?