def __init__(self, context, request): BrowserView.__init__(self, context, request) notes = INotes(context) self.notes = [note for note in notes if note.privacy == 'public' or note.owner == request.principal.id] if 'DELETE_NOTE' in request: notes.remove(request['uid'])
def __init__(self, context, request): BrowserView.__init__(self, context, request) notes = INotes(context) self.notes = [ note for note in notes if note.privacy == 'public' or note.owner == request.principal.id ] if 'DELETE_NOTE' in request: notes.remove(request['uid'])
def add(self, note): """Add `note` to the object.""" notes = INotes(self.context) notes.add(note) return note