1
0
Fork 0
emacs-config/oni-python/snippets/python-mode/form_valid

8 lines
381 B
Text
Raw Normal View History

2019-08-28 09:06:55 +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)