Aug. 13th, 2009

elfs: (Default)
This morning, I had my first ride on the new Link Light Rail project through the valley from Tukwila to Seattle. I'll have photos up later, although really it's not that big a deal. But when I got off, the elevator to 5th Ave was out of order, so I took the stairs instead.

The entire flight of stairs was completely thick with marijuana smoke. It reeked. I haven't smelled anything like that since high school, and probably not with quite that intensity. By the time I got through the doors and out onto the street, my eyes were watering, my throat itched, and (it was probably just my imagination, but) I felt weird.
elfs: (Default)

For multi-select boxes where you have a list of things you want to filter on, and you want the queryset returned to be an OR’d set.

    qset = Q(mode__exact=modes[0])
    if len(modes) > 1:
        for mode in modes[1:]:
           qset = qset | Q(mode__exact=mode)
    r = Responses.objects.filter(qset)

Now, I need to figure out how to do this as a list comprehension!

For extra coolness, you can see what SQL you’re generating:

    print r.query.as_sql()
This entry was automatically cross-posted from Elf's technical journal, ElfSternberg.com

Profile

elfs: (Default)
Elf Sternberg

December 2025

S M T W T F S
 12345 6
78910111213
14151617181920
21222324252627
28293031   

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Jan. 4th, 2026 08:41 pm
Powered by Dreamwidth Studios