added django < 1.6 compatibilty for permission codename generation