rattail-demo/rattail_demo/web/views/people.py
2019-06-15 15:31:09 -05:00

32 lines
784 B
Python

# -*- coding: utf-8 -*-
"""
Person views
"""
from __future__ import unicode_literals, absolute_import
from tailbone.views import people as base
class PeopleView(base.PeopleView):
"""
Prevent edit/delete for Chuck Norris
"""
def editable_instance(self, person):
return person.uuid != '30d1fe06bcf411e6a7c23ca9f40bc550'
def deletable_instance(self, person):
return person.uuid != '30d1fe06bcf411e6a7c23ca9f40bc550'
def includeme(config):
# autocomplete
config.add_route('people.autocomplete', '/people/autocomplete')
config.add_view(base.PeopleAutocomplete, route_name='people.autocomplete',
renderer='json', permission='people.list')
PeopleView.defaults(config)
base.PersonNoteView.defaults(config)