GenericView: Attributeerror ‘list’ object has no attribute ‘filter’ // 1-second guide 😮💢

So you are casually overriding get_queryset() in a, say, ListView, like this:

def get_queryset(self):
    entries = [x for x in Entry.objects.all() if x.publications]
    return entries

Because you need to sort the Entry table by a reverse M2M relation publications and then BAM!:

Attribute error 'list' object has no attribute 'filter'

Without a trace of the line you made a mistake in…

Read More »

Copyable table column // 1-minute guide 🌺 🐋

I like Excel for the ability to copy the whole column, and HTML tables don’t normally provide that. As a result, tons of time and nerves spent on copying cell by cell, cell by cell…

My friend and colleague (who btw likes HTML tables but in Adobe Dreamweaver graphic mode) needs a lot of data searched and sorted and put in table, but also copyable. Hm…

So, let’s make HTML tables great!

sidenote In my examples, tables are light blue, and cells are pink.

Read More »