| 59 | = Yasnippet = |
| 60 | |
| 61 | If you are using [http://code.google.com/p/yasnippet/ Yasnippet], you can make quick the definition of basic classes for the administration site with the following yasnippet recipe: |
| 62 | {{{ |
| 63 | # -*- coding: utf-8 -*- |
| 64 | # name: classadmin |
| 65 | # -- |
| 66 | class ${1:ClassName}Admin (admin.ModelAdmin): |
| 67 | pass |
| 68 | admin.site.register($1, $1Admin) |
| 69 | |
| 70 | }}} |
| 71 | |
| 72 | It will produce code like this: |
| 73 | {{{ |
| 74 | class ExpenseAdmin(admin.ModelAdmin): |
| 75 | pass |
| 76 | admin.site.register(Expense, ExpenseAdmin) |
| 77 | }}} |