HNHacker News
TopNewBestAskShowJobs

gedazz

8 karma · joined February 17, 2012

submissionscomments
gedazz··on Nuitka: a Python compiler written in Python
What does CoC stand for?
gedazz··on Many small queries are efficient in SQLite
I have never encountered this issue in Django. Perhaps your post lacks some context. Is `friends` a custom method/property? Asking because I'm used to seeing attributes like `friends_set`.

The only scenario I see where your example would need `prefetch_related` is if your snippet looked something like this:

    {% for user in all_users %}
        <ul>
        {% for friend in user.friends.all %}
        <li>{{ friend.name }}</li>
        {% endfor %}
        </ul>
    {% endfor %}
To avoid the classic N+1 query problem, all_users must be loaded like so:

    User.objects.all().prefetch_related("friends")
If you're writing verbose expressions such as this in Django:

    User.objects.filter(pk=<pk>).prefetch_related("friends").first()
You must be doing something wrong.
gedazz··on Ask HN: How do you manage your bookmarks?
Besides pushing articles I want to read later to Pocket I tend to use the principle "if I cannot remember the name/address of the website, I do not need to bookmark or visit it". Browsers nowadays are excellent at autocompletion which kind of supersedes bookmarks.
gedazz··on PyCon US 2014 – Videos
There are more on their Youtube channel https://www.youtube.com/channel/UCFDHJGm0IxH9uwcIHfR72yg/vid...