content_type = ContentType.objects.get_for_model(self.__class__)
url = urlresolvers.reverse('admin:%s_%s_change' % (content_type.app_label,
    content_type.model), args=(self.id,))
How to get an app name using python in django