Changes between Version 9 and Version 10 of Emacs


Ignore:
Timestamp:
Apr 22, 2009, 11:24:15 AM (16 years ago)
Author:
freyes
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Emacs

    v9 v10  
    5757}}}
    5858
     59= Yasnippet =
     60
     61If 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# --
     66class ${1:ClassName}Admin (admin.ModelAdmin):
     67    pass
     68admin.site.register($1, $1Admin)
     69
     70}}}
     71
     72It will produce code like this:
     73{{{
     74class ExpenseAdmin(admin.ModelAdmin):
     75    pass
     76admin.site.register(Expense, ExpenseAdmin)
     77}}}
Back to Top