Monthly Archive for March, 2007

Accessing django permissions inside templates

built in permissions system is another piece of excellent functionality you get for free when you use the framework. Each “model” (database table) automatically gets create, delete and change permissions that you can assign to django users and groups. You can create custom permissions per model. Users inside groups inherit permissions assigned to groups. More on that .

Not only views but templates have access to the currently logged in user’s permissions, but it’s not entirely obvious how to get there. You need to pass a RequestContext object to the template first. Here’s how you do it.

from django.template import RequestContext
return render_to_response("mytemplate.html", context_instance=RequestContext(request))

It seems I wasn’t the only one to read the documentation and still not have the objects working in my templates. I searched the django users group and found the posted the same day I started looking at it. A comment in the documentation pointed me to the fact that you need to explicitly pass the object to the template in the render_to_response.

I suppose this highlights the value of using a comments system in documentation, with being one of the best examples I’ve seen of this.

Whitsundays photoset

My wife and I spent last week on my boss’ boat in Hamilton Island. Apparently they haven’t had a wet season for 5 years now. Well they did this year, but we managed to get out into the islands for a couple of days. It was good to get away for a week. We left a day before a tropical cyclone came close to the area.


Queen Mary 2 photoset

I started playing around with the 1.0 release of Lightroom last night, finally getting around to looking at the photos taken when the Queen Mary 2 . It’s fast and the workflow is intuitive. It certainly beats my old method of using iPhoto to import and organise and Photoshop with ACR to do RAW conversion. Check out the photoset below.


It’s not cheating?

A colleague of mine alerted me to this Office promotion from Microsoft. For all intents and purposes it looks like a spam site, so much so that they’ve added a link at the bottom to “proving” that it’s real.

Don’t believe it’s real?

The domain appears to be owned by an “AMNESIA CREATIVE PTY LIMITED”. Perhaps they want us to forget that this goofy mock-spam site exists?

My favourite is the top 5 it’s not cheating lines:

Top 5

I wonder if this is a change in policy on Microsoft’s part. Perhaps Office isn’t cheating if you don’t get caught.

Windows Mobile MMS exploit

With so many different phone operating systems out there it seems that the standards war in the web browser space pales in comparison to presentation of content on the mobile phone. Take MMS SMIL for example. for quite some time now and a tiny subset of this, MMS SMIL, being a .

An example of incompatibilities between phones is the hyperlink element. A modern doesn’t support linking to an HTTP URL, yet a does. My N73 opens up it’s WAP browser as expected and browses to the linked URL. It looks like you can click on the link on the 6233 but nothing happens. Even amongst the same manufacturer the behaviour is different (maybe the series 40 team that much). Because of this we often see SMIL guides .

I was searching for such a guide for Windows Mobile phones when I came . I made a comment at the time wondering if there was any method you can’t use to get viruses onto Windows.

The interesting thing is that it appears that the SMIL interpreter is completely removed from Windows Mobile 5, at least in the case of my (is it possible to find an HP product page that doesn’t try and sell you the item?). Older iPAQs I’ve tried seem to work fine with basic SMIL elements but the newer ones don’t. I haven’t tried other Windows mobile devices so perhaps HP removed the interpreter as a precaution?

Hopefully these issues have been fixed in . By the way, how do I update my existing device?

Storms in Sydney last night

I managed to catch some of the lightning last night. Check out some of the photos below.

Pity about the dust hair that appears just at this next set of photos.

There are more on my flickr account. Check out the set .

Nature truly is magnificent!