It is a common need to have per-row (instance) permissions in a web application.

I’ve created a very simple and non intrusive module to help with that.

You can find the source code of the django-granular-permissions on Google Code here:

http://code.google.com/p/django-granular-permissions/

It’s fully functional, only thing missing are unittests and templatetag that would use the request.user provided by the session middleware context.

To use the package simply add it somewhere to your PYTHONPATH (ie. under your django project, or use

easy_install -U django-granular-permissions

to grab it from cheeseshop) and add the ‘django_granular_permissions’ to your INSTALLED_APPS in your projects settings.py

That’s it. From now on you can check, add and remove permissions for any instance of models class in your project like this:

Python [Show Plain Code]:
  1. # adding permission ‘edit’ to a user ‘Bart’ on an instance of a MyObject from myapp.models
  2.  from django.contrib.auth.models import User, Group
  3.  from myapp.models import MyObject
  4.  user = User.objects.get(username=‘Bart’)
  5.  obj = MyObject()
  6.  obj.save()
  7.  user.add_row_perm(obj, ‘edit’)
  8.  user.has_row_perm(obj, ‘edit’)
  9. True
  10.  user.has_row_perm(obj, ‘delete’)
  11. False
  12.  
  13. # similar for groups
  14.  group = Group.objects.get(pk=1) # get first group in the db
  15.  group.add_row_perm(obj, ‘read’)
  16.  
  17. # now we’ll add the user to the group and he will inherit the ‘read’ permission
  18.  user.groups.add(group)
  19.  user.has_row_perm(obj, ‘read’)
  20. True
  21.  
  22. # now to remove permission
  23.  user.del_row_perm(obj, ‘edit’)
  24.  user.has_row_perm(obj, ‘edit’)
  25. False
  26.  
  27. # note that when you try to remove a permission from a user that is granted to him through group nothing changes
  28.  user.del_row_perm(obj, ‘read’)
  29.  user.has_row_perm(obj, ‘read’)
  30. True

Woah it’s been a while since last post hehehehe.

Well stay tuned (anyone? :P) for some updates and more thoughts and tips soon.

After some delays and then some more delays SL-messenger.com 2.0 is closing in fast to public release.

There are some big changes in the new version, completely overhauled database design for speed (don’t worry we’ll migrite all your data from 1.0 to 2.0), Twitter/Jaiku support, Jabber, GTalk, MSN, AIM, ICQ, Gadu-Gadu support - yes you’ll be able to chat with your IM friends from SL :-), bookmarks, region rankings, screenshots, new badges and badge creation wizzard, and of course new web design.

Stay tuned.

So you have upgraded your iPod to 1.1.2 by accident (or am I only one that stupid:P) and you’d like to downgrade back to 1.1.1 so you can jailbreak it?
Nothing easier done…
Download the 1.1.1 firmware
Start iTunes and click on the iPod on the left menu.
Hold down ALT and click on Update button. This will open a file selection menu, choose the firmware file you’ve downloaded.
After 1~2min you should be happy 1.1.1 iPod user :-) now only a quick visit on jailbreakme.com and you’re done.

“The Witcher” had been developed for many years now, originally based on NWN engine it grew to something beautiful.
The Witcher (or in polish original “Wiedzmin”) is based on Andrzej Sapkowski’s novels. Sapkowski is one of my favorite polish writers and I’ve read all of his work (even those that was published years ago in some fantasy magazines before he became famous).
As with many good literature like in this case someone had this brilliant idea to make a movie based on it.
Unfortunately for fans, polish movie directors got their hands on an exclusive rights to shoot the movie and that guaranteed them time (I believe it was 2years) before anyone else could even think about creating a movie based on the novels, and to my knowledge some Holywood producers were looking into it (god I was so suprised when I’ve seen intro to “Beowulf” with Christopher Lambert - I thought: ‘No way they’ve made Wiedzmin!’ as the main character resembles Witcher so much :) )
Anyway, long story short, the movie was a hoax. Then they’ve made a TV series, which was bad, but not as much as the movie.

So I’ve lost my hopes in polish productions. Don’t know why, I know that we have good programers and talented graphic artists in Poland (hey I’m one of them right? :) ) but somehow I’ve pushed away the idea of a good game based on The Witcher novels and after like 4years after the development started I almost forgot about it, until now.

So, on Sunday I’ve visited GameStop looking for a RPG to waste time on as my mood pointed me to this genre at the time. To be honest I was looking for the NWN2 Mask of the Betrayer, when my eyes landed on a familiar sign - the Witcher’s medallion - a wolf’s head. After few moments of gazing at the back where you can find microscopic sized screenshots I said to myself what the hell at least I’ll support the guys who made it in some way if I’ll buy it. Same afternoon I’ve installed it and the game sucked me in good. My girlfriend gave up trying talk to me when she saw that I’m not giving any responses beside “mhm”, “right”, “yeah you’re right” and I’ve got totally immersed into the world I came to know so well.
Some monsters and characters I’ve imagined a bit differently but hey, overall I’ve got great impression from the art.
Game runs on almost highest settings on my rig (Intel Pentium D 2,66GHz, ATI Radeon X1950XTX, 2GB DDR2) but to be honest the system could use a reinstall. I’ve just had to change the resolution down to 1024×768 and the anizo down to x8 and I’ve got constant 20-30FPS which is playable enough for this kind of game and the sights are uh oh gorgeous.
The dialogues are technically on a level of Fallout, they repeat themselves if you try to talk to one person second time, you’re getting same ‘hello’ kind of message from a NPC you’re trying to talk to, but still the story and immersion is great.
You can evolve your character as you gain more experience, or perhaps as you recover your experience after loosing all memory as Geralt, the main character, is one of the best Witchers around, well was, err will be again ;) So you have 4 attributes Strength, Dexterity, Stamina and Intelligence. Each one of them has five levels of advancement. First two require bronze skill points, third and fourth requires silver, and fifth gold. Investing in each level unlocks set of skills you can invest in same kind of points as in the level itself.
Beside attributes you can (re)learn witcher’s signs. They are kind of simple magic signs ie for telekinesis (Aard sign), causing pain (Yrden sign), fireball (Igni sign), etc.
Witchers also know their way in alchemy, so we’re be also able to brew potions that will boost us in those dark, smelly sewers, crypts, graveyards, forests or dungeons. Witchers are mutants, by definition they’re faster, stronger, more durable than humans, but they also have limits on how much they can handle. So beside the stamina and everobious HPs you have a toxicity level. More stuff you drink that you’ve brewed, more screwed you get. Of course you can invest a bit more in the elixir base (which is alcohol) to have better quality potions(stronger the better).
I must say it’s a game that doesn’t get borring after 30min, heck after 4hrs that I’ve spent the other day I was considering - warm bed or zombie-like appearance next day. I’ve chosen bed not because the game isn’t good enough to sacrifice a good night sleep, but because I’m a good boyfriend and my girl needs a goodnight hug ;) Anyhoo I believe that the 80+ hrs of gameplay is not overestimated, and not only because of longish load times between locations, but because there’s so much going on, and the amount of great cinematographic moments in the game just keeps you glued to the keyboard and mouse glazing at the screen.
There’s nothing more funny and exciting to get drunk in an inn with your ol’friend dwarf Zoltan and fist fight with some peasants when the screen is blurry and our character barely stands on his feet.
Anyway it’s a bit too soon for me to give a good overall review of the game, but from what I’ve seen so far I can recommend this game to anyone looking for great time playing RPG and all fans of Sapkowski’s work.

And here I am again in Paris :)
I didn’t have much time yesterday to sniff around the expo, just walked by near it, but still I’ve took this footage of an interesting motorbike.

Today I hope to generate 1-2hrs to visit the expo. Especially because it’s just next door to where I work right now ;)

I’ve just got myself an upgrade phone - Nokia E65. I’ve chosen this one mostly because it has wifi and it comes with Skype installed.
After a short while I felt somewhat not satisfied with the pre-installed Skype. It works only through 3G and that’s a huge issue for me right now as I live in a poor reception area.

So after googling a bit I’ve stumbled upon fring.
This cool little app is like Norton Commander was for your DOS 5 ;)
It takes your Skype, Jabber, GTalk, AIM, (and so on) contacts, adds your contacts from your mobile phone and let’s you use nearby WiFi or 3G connection to make calls and chat like you would normally do with your mobile but through service provider of your choice - make it your GSM provider, Skype, Fring - no problem.
You can set it up to launch every time you turn on your mobile.

The only issue I have found so far, and it’s most likely related to E65 firmware, is that every once in a while for no reason the mobile soft-reboots itself while having fring and wifi connection active.

Overall I recommend this app for everyone that has a symbian mobile and has some internet connectivity (3G/WiFi) and uses Skype.

This thing is even more funny now than back in the times of MS-DOS 5 ;)

So it’s my 4th day in Paris, finally weekend, time of slacking around and it’s about time to know Paris a bit better :-)

My adventurous nature forced me to go wild on this first day on the unknown land…
I’ve decided to go on foot… which ofcourse is not the best idea in a city that size :)
But I’ve found my way to Louvre, where I’ve spent most of the time today. I’ve bought myself a map with all the places of interest clearly marked and I’ve planned my tour for tomorrow :)

So, tomorrow I will take metro no. 4 to Montparnasse, there I’ll go up on to the roof of the Mountparnasse tower… being the tallest building around, this should be a nice view. I may have a quick look at the Musee de la Poste (it may be interesting). Then I’ll take metro no. 6 to get to Champ de Mars, to see the Eifel tower of course :). From there on foot I’ll go to Trocadero gardens. After a brief stop there I’ll head towards the Arc of Triumph, and from there via the Champ Elysees I’ll head to see the Parc de Monceau. From there fast forward by metro no. 7 to Porte de Villette to see the City of Science and Industry, especially the La Cinaxe and the La Geode. Then I’ll have a quick look at the submarine L’Argonaute and chill out in the Parc de la Villette. Then if I’ll have some time left I’ll visit the Musee de la Musique and head back to the hotel… phew this is gonna be a long day :)

Below are the photos I’ve taken so far.

I’m pleased to announce that I’m starting to work for WaveStorm. I’ve been developing stuff for Alexander (CEO of WaveStorm) for a while, and now I’m joining his company as a PHP/AJAX developer.
Next week - a trip to Paris to meet the rest of the team :-) And since I’ve never been to Paris this makes it even more exciting.

Woohoo!