rattail-demo/rattail_demo/web/views/employees.py
2016-12-10 16:04:34 -06:00

31 lines
795 B
Python

# -*- coding: utf-8 -*-
"""
Employee views
"""
from __future__ import unicode_literals, absolute_import
from tailbone.views import employees as base
class EmployeesView(base.EmployeesView):
"""
Prevent edit/delete for Chuck Norris
"""
def editable_instance(self, employee):
return employee.person_uuid != '30d1fe06bcf411e6a7c23ca9f40bc550'
def deletable_instance(self, employee):
return employee.person_uuid != '30d1fe06bcf411e6a7c23ca9f40bc550'
def includeme(config):
# autocomplete
config.add_route('employees.autocomplete', '/employees/autocomplete')
config.add_view(base.EmployeesAutocomplete, route_name='employees.autocomplete',
renderer='json', permission='employees.list')
EmployeesView.defaults(config)