legacy-dotfiles/emacs/snippets/python-mode/form_valid
Tom Willemsen a281f040cd Move .emacs.d to emacs
Since it's no longer placed directly in the home directory it doesn't
need to be named exacly the same.
2013-02-17 23:09:33 +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)