~widelands-dev/widelands-website/django_staticfiles

« back to all changes in this revision

Viewing changes to pybb/admin.py

  • Committer: Holger Rapp
  • Date: 2009-03-15 16:40:37 UTC
  • mto: This revision was merged to the branch mainline in revision 64.
  • Revision ID: sirver@kallisto.local-20090315164037-6sbx3vlo089d46e8
Added support for profiles. No gravatar yet

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
# -*- coding: utf-8
2
2
from django.utils.translation import ugettext_lazy as _
3
3
from django.contrib import admin
4
 
from pybb.models import Category, Forum, Topic, Post, Profile, Read
 
4
from pybb.models import Category, Forum, Topic, Post, Read
5
5
 
6
6
class CategoryAdmin(admin.ModelAdmin):
7
7
    list_display = ['name', 'position', 'forum_count']
66
66
         ),
67
67
        )
68
68
 
69
 
class ProfileAdmin(admin.ModelAdmin):
70
 
    list_display = ['user', 'time_zone', 'location', 'language']
71
 
    list_per_page = 20
72
 
    ordering = ['-user']
73
 
    search_fields = ['user__username', 'user__first_name', 'user__last_name']
74
 
    fieldsets = (
75
 
        (None, {
76
 
                'fields': ('user', 'time_zone', 'markup', 'location', 'language')
77
 
                }
78
 
         ),
79
 
        (_('IM'), {
80
 
                'classes': ('collapse',),
81
 
                'fields' : ('jabber', 'icq', 'msn', 'aim', 'yahoo')
82
 
                }
83
 
         ),
84
 
        (_('Additional options'), {
85
 
                'classes': ('collapse',),
86
 
                'fields' : ('site', 'avatar', 'signature', 'show_signatures')
87
 
                }
88
 
         ),
89
 
        )
90
 
 
91
69
class ReadAdmin(admin.ModelAdmin):
92
70
    list_display = ['user', 'topic', 'time']
93
71
    list_per_page = 20
99
77
admin.site.register(Forum, ForumAdmin)
100
78
admin.site.register(Topic, TopicAdmin)
101
79
admin.site.register(Post, PostAdmin)
102
 
admin.site.register(Profile, ProfileAdmin)
103
80
admin.site.register(Read, ReadAdmin)