“无法解析余数”错误

时间:2013-08-27 15:28:08

标签: python html django permissions haml

我正在尝试检查特定组是否有权修改其他类型的组

def can_write_object(self, obj):
    return (self.user.is_staff or
        self.userprofile.has_permission(obj, Permission.READ_WRITE))

如果policy.can_write_object()函数返回true

,我只希望显示此按钮
- if groups
    - for group in groups
        .btn-group
            - if policy.can_write_object(group)
                %a.btn.btn-mini{
                :data-toggle => "modal",
                :onclick => "$(\"#groupmodalcontainer\").load(\"{% url group group.id %}\");",
                }
                Modify Group

但是,我一直收到此错误

TemplateSyntaxError

Could not parse the remainder: '(group)' from 'policy.can_write_object(group)'

0 个答案:

没有答案