Filters are addictive! (GSoC 2010 Week 3)

The last two weeks I have spent a bit more time than I expected playing with filters, filters and more filters. The first iteration went in maybe a bit too quickly, so I have done quite a bit of clean-up. Python is being too lenient with me!

I’m finally pulling my head out of the code and looking at this from further back, and from here things are looking pretty cool. There is still a lot of stuff in the implementation that needs fixing, but it is entirely possible to start playing with something else without wasting any effort.

 

Yes, that bar on the left is for controlling the filters! Clicking on a filter toggles it, which is done by loading a new URL with the appropriate parameters appended so Harvest knows what to do. The debug toolbar is reminding us that performance is still pretty ugly, but most of those SQL queries are from the opportunities list below each package. Some time in the next few weeks I will be moving that feature so it only appears on demand.

As for the other filters, those are coming. At this point it should be pretty easy to get a rough implementation of everything that is on the left side in the mockup. They won’t be pretty, but they should work. Just extend one of the Filter base classes, add a custom function for manipulating a queryset, override the render function if desired, and it’s done!

All the HTML stuff for that filters bar had to be implemented in Python, rather than the template. It’s the same kind of design as Django’s own forms module, so I think it is forgiveable…

Speaking of filters, I’ve developed a dangerous obsession with The GIMP’s collection of goodies. Quite proud of this rendering I made for a friend. It’s proof he looks exactly like Tintin!

It was straight-forward to do. I used the toon filter and oil painting filter to add outlines and soften the details. Then I whipped out the trusty liquid rescale to make his face a little taller (which worked beautifully given that the other details were insignificant). Finally I did some extra brush work to mimic Herge’s drawing style, making colours more solid and connecting some lines.

In the end it’s probably too subtle, and it would have been easier (though slightly less exciting) to draw it from scratch. Still, it was an interesting exploration. I look forward to doing this to more peoples’ heads in the future.