legacy-dotfiles/.emacs.d/snippets/python-mode/form_valid
Tom Willemsen 62ea1086e9 Emacs: Manually set-up w3m
Only `w3m-goto-url' and `w3m-bookmark-view' are ever really used to
start w3m, no need to load `w3m-load' for that.
2012-12-28 01:56:58 +01:00

8 lines
No EOL
381 B
Text

# -*- mode: snippet -*-
# name: Record form
# key: defm
# --
@record_activity(model=${1:`(progn (re-search-backward "^[ \t]*model = \\([a-zA-Z_].*\\)$") (match-string 1))`})
def form_valid(self, form):
'''Make sure any changes to the $1 model get logged.'''
return super(${2:`(progn (re-search-backward "^[ \t]*class \\(.+\\)(") (match-string 1)))`}, self).form_valid(form)