Two days ago I was thinking: What can I do[1]? And I ended up with the idea of doing Just Another Online To Do List.

The challenge was to finish the project in one day. Yesterday I programmed the application and now is up and running:

The web page lets you create a new ToDo list (or Task list) and you can put all the jobs you want in there. Once you have done one of the thinks listed on the ToDo List you can go there and mark it as "done". The job will not be deleted but just marked as done. This is because I love lists. And what I love about lists is that I can just cross off the jobs I've done. If you really want to delete a job done, you can just edit the job by clicking on the job, delete the content, and press . Job deleted! And that's all! If you want to access later in your ToDo List, you must save the "ID" that appears on the top of the main screen. This is the unique identifier for your ToDo List. Don't loose it! Of course you can share this identifier with a friend and he/she will be able to use this list too.

More technically, the project has been done with the python web framework Bottle, sqlite3 and MooTools as JS framework.

  • Python: ~~130 lines~~ 99 lines (after some refactoring)
  • Python dependences: 5 [bottle, beaker, webob, distribute, wsgiref]
  • HTML: 46 lines
  • JavaScript: 45 lines + MooTools 1.4.5
  • CSS: 82 lines (+ a funny font type called RockSalt)
  • Hours spend: 10.
  • Lines commented: Null. None. /dev/null. 404. Not found.  Unexistent. nil. undef. zero.

I've split (as always) the logic done in the web server and the logic related with the data access. Normally this is just for a better readability of the code, but with a 130 lines of python is not that better. Probably without spliting the code this way we could save about 15~ lines. In Bottle framework we have a SQLite plugin that I want to test. Maybe this project can be a very good oportunity for do it and put all the HTTP logic and the DDBB access in the same place. I'm using AuthenticationMiddleware for being able to know if I'm logged or not. Being logged is just having entered a valid ToDO ID.

And that's all. In the next post I'll explain all the Python source code and can be very useful for you if you want to do something simple with the PyBottle framework.

See you round!

[1] It's always the same question. Aaaaaaalways the same: What to do.  I went to the beach (yeah, exactly that one. Cool isn't it?) and I have a sunburned back, so I have to stay at home doing stuff... :/ Gosh. I want a life!