Sean Schulte

Twitter: @sirsean


Due to overwhelming demand from exactly 100% of our users, Things I Did now has todo items.

A Thing can either be a thing you did, or a thing you have to do. If it's a todo, just enter an @ character as the first character when you enter it, followed by a space and then whatever else you want the Thing to be (including any number of tags).

Adding it in was pretty simple.

def checkForTodoItem(self):
    regex = re.compile('^@')

    if regex.match(self.text):
        self.text =  self.text.replace('@', '', 1).strip()
        return True
        return False

Note that I only want to grab 1 of the @, and only if the string starts with one. You can still have Things with @ characters in them. Just in case you wanted to do that. Which exactly 0% of our users have ever wanted to do. Hence, you must be crazy if you wanted to do that.

And then when I save it I just call

thing.todo = thing.checkForTodoItems()

and the deed is done.

I made it so the todo items show up separately from the regular things, at the top, and are a different color. The same is true even when you're viewing all the things marked with a tag, so you can tell which things you haven't done yet.

And you can mark an item done by clicking on the "Done" link on the main /did/ page. Marking it as no longer a todo item and just a Thing you did is as simple as:

if thing.todo:
    thing.todo = not thing.todo

Bam. Done.

Things I Did just got a whole lot more useful. You don't have to wait until after you do a thing before you enter it in!