cciw-website / cciw / cciwmain /

from cciw.cciwmain.models import Site, Person, Camp, Forum, NewsItem, Topic, Gallery, Photo, Post, Poll, PollOption, MenuLink, HtmlChunk, Permission, Member, Award, PersonalAward, Message
from django.contrib import admin

class SiteAdmin(admin.ModelAdmin):
    fieldsets = (
        (None, {'fields': ('short_name', 'long_name', 'info')}),

class PersonAdmin(admin.ModelAdmin):
    filter_horizontal = ('users',)

class CampAdmin(admin.ModelAdmin):
    fieldsets = (
        (None, {'fields': ('year', 'number', 'age', 'start_date', 'end_date',
                           'chaplain', 'leaders', 'site', 'previous_camp',
                           'online_applications', 'admins')
    ordering = ('-year','number')
    def leaders(camp):
        return camp.leaders_formatted
    list_display = ('year', 'number', leaders, 'chaplain', 'age', 'site', 'start_date')
    list_display_links = ('number', leaders)
    list_filter = ('age', 'site')
    filter_horizontal = ('leaders', 'admins')
    date_hierarchy = 'start_date'

class ForumAdmin(admin.ModelAdmin):

class NewsItemAdmin(admin.ModelAdmin):
    list_display = ('subject', 'created_at', 'created_by')

class TopicAdmin(admin.ModelAdmin):
    list_display = ('subject', 'started_by', 'created_at')
    search_fields = ('subject',)
    date_hierarchy = 'created_at'

class GalleryAdmin(admin.ModelAdmin):

class PhotoAdmin(admin.ModelAdmin):

class PostAdmin(admin.ModelAdmin):
    list_display = ('__unicode__', 'posted_by', 'posted_at')
    search_fields = ('message',)
    date_hierarchy = 'posted_at'

class PollOptionInline(admin.TabularInline):
    model = PollOption

class PollAdmin(admin.ModelAdmin):
    list_display = ('title', 'created_by', 'voting_starts')
    radio_fields = {'rules': admin.HORIZONTAL}
    inlines = [

class PollOptionAdmin(admin.ModelAdmin):
    list_display = ('text', 'poll')

class MenuLinkAdmin(admin.ModelAdmin):
    list_display = ('title', 'url', 'listorder','visible','parent_item')

class HtmlChunkAdmin(admin.ModelAdmin):
    list_display = ('name', 'page_title', 'menu_link')

class PermissionAdmin(admin.ModelAdmin):

class MemberAdmin(admin.ModelAdmin):
    search_fields = (
        'user_name', 'real_name', 'email'
    list_display = (
        'user_name', 'real_name', 'email', 'date_joined', 'last_seen'
    list_filter = (
    radio_fields = {'message_option': admin.HORIZONTAL}
    filter_horizontal = ('permissions',)

class AwardAdmin(admin.ModelAdmin):
    list_display = ('name', 'year')

class PersonalAwardAdmin(admin.ModelAdmin):
    list_display = ('award', 'member','reason', 'date_awarded')
    list_filter = ('award',)

class MessageAdmin(admin.ModelAdmin):
    list_display = ('to_member', 'from_member', 'time'), SiteAdmin), PersonAdmin), CampAdmin), ForumAdmin), NewsItemAdmin), TopicAdmin), GalleryAdmin), PhotoAdmin), PostAdmin), PollAdmin), PollOptionAdmin), MenuLinkAdmin), HtmlChunkAdmin), PermissionAdmin), MemberAdmin), AwardAdmin), PersonalAwardAdmin), MessageAdmin)

from django.contrib.auth import admin
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.