legacy-dotfiles/emacs/.emacs.d/snippets/python-mode/form_valid

8 lines
381 B
Text
Raw Normal View History

2014-08-21 00:23:56 +02:00
# -*- 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)