~ivan-zderadicka/mybookshelf/trunk

« back to all changes in this revision

Viewing changes to ebook/admin.py

  • Committer: ivan-zderadicka
  • Date: 2012-07-23 14:23:06 UTC
  • Revision ID: ivan-zderadicka-20120723142306-ocw7jx04p38yd01t
Links to admin site for superusers

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
 
28
28
class EbookAdm(admin.ModelAdmin):
29
29
    ordering=['author__search_name', 'search_title']
30
 
    list_filter=['author']
31
 
    filter_horizontal=['subjects']
 
30
    
 
31
    filter_horizontal=['subjects', 'other_authors']
32
32
    list_select_related=True
33
33
    search_fields=['title', 'search_title', 'author__name', 'author__search_name']
34
34
    
 
35
    raw_id_fields=['serie']
 
36
    save_as=True
 
37
    
35
38
    def save_model(self, request, obj, form, change):
36
39
        obj.set_title(obj.title)
37
40
        obj.save(user=request.user)
38
41
        
39
42
class SerieAdm(admin.ModelAdmin):
40
43
    ordering=['author__search_name', 'search_title']
41
 
    list_filter=['author']
42
44
    list_select_related=True
43
45
    search_fields=['title', 'search_title', 'author__name', 'author__search_name']
 
46
    filter_horizontal=['other_authors']
 
47
    save_as=True
44
48
    
45
49
    def save_model(self, request, obj, form, change):
46
50