def __new__(cls, name, bases, attrs):
    new_class = super(PublishableBase, cls).__new__(cls, name, bases, attrs)
    opts = new_class._meta
    name = (u'Can publish %s' % opts.verbose_name)
    code = (u'publish_%s' % opts.object_name.lower())
    opts.permissions = (tuple(opts.permissions) + ((code, name),))
    opts.get_publish_permission = (lambda : code)
    return new_class
def __new__(cls, name, bases, attrs):
    new_class = super(PublishableBase, cls).__new__(cls, name, bases, attrs)
    opts = new_class._meta
    name = (u'Can publish %s' % opts.verbose_name)
    code = (u'publish_%s' % opts.object_name.lower())
    opts.permissions = (tuple(opts.permissions) + ((code, name),))
    opts.get_publish_permission = (lambda : code)
    return new_class