Viewing profile — Suor
Suor
HN member- Joined
- Wed, Oct 26, 2011, 9:44 AM UTC
- HN karma
- 614
- Public activity
- 65 items
- HN profile
- View on Hacker News ↗
About Suor
No profile information was provided.
Recent public activity
-
comment
Comment #35327202
Writing things directly is tightly coupling code. Sometimes quite distant portions of it, i.e. database access and presentation logic. With ORM and some smarter lazy technics or in…
-
comment
Comment #35325130
Never used this, but I see that it provides a context manager/decorator, which you can use to "shield" any code. And also some shortcuts for DjangoREST or something. Regarding extr…
-
comment
Comment #35325105
cacheops is more of a general purpose ORM caching with automatic invalidation.
-
comment
Comment #35322678
For that fetching in chunks is usually a way to go. I use something of these usually https://handy.readthedocs.io/en/latest/db.html#queryset_iter...
-
comment
Comment #35322580
GraphQL makes it even more fun :)
-
comment
Comment #35321704
I usually use `.values()` and `.values_list()` only when model creation is really slow. Usually many rows fetched.
-
comment
Comment #35321555
Actually there is such thing already https://pypi.org/project/django-auto-prefetch/ Not a monkey patch though, so will only work on the models you inherit from this.
-
comment
Comment #35321537
Here is an example of such thing https://github.com/Suor/django-cacheops/blob/8b3a79de29b2545...
-
comment
Comment #35321523
Should be easy enough to implement. You only need a context manager that adds 1 to some threadlocal flag on enter and subrracts on exit then check this flag in the monkey patch. No…
-
comment
Comment #35321476
cacheops can do the same, but it never came to my mind to actually go this way. I would rather write some special code to fetch with `id__in=[...]` and then cache individually.
- story
- story
-
comment
Comment #35314339
HN keeps automatically replacing the URL. It used to be a redirect before, but not anymore
- story
-
comment
Comment #35314190
Thanks
- story
- story
- story
- story
- story
- story
- story
-
comment
Comment #9168483
Using framework has its cost, so you can be better of if you understand clearly what you are doing. OTOH, framework brings structure so it's less probable you skrew up your design.…
-
comment
Comment #9168473
There are sure some things I haven't covered. The major one is components, which make a big deal in factor, reuse and composition. But the post started to be too long and loosing p…
-
comment
Comment #9166077
I've already emailed there, won't make a difference probably anyway. I hate this HN tricky rating, one my post got dumped from top 5 cause there were too many comments! Reddit kind…