Adding the Improve model to the django admin
[cascardo/ema.git] / eventos / admin.py
1 # -*- coding: utf-8; -*-
2 # Copyright (C) 2008 Marcelo Jorge Vieira (metal) <metal@alucinados.com>
3 #
4 # This program is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU General Public License as
6 # published by the Free Software Foundation; either version 2 of the
7 # License, or (at your option) any later version.
8 #
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12 # General Public License for more details.
13 #
14 # You should have received a copy of the GNU General Public
15 # License along with this program; if not, write to the
16 # Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17 # Boston, MA 02111-1307, USA.
18
19 from django.contrib import admin
20 from eventos.models import *
21
22 class EventoAdmin(admin.ModelAdmin):
23     fieldsets = (
24         (u'Informações do evento',
25          {'fields': ('nome', 'data_inicio', 'data_final', 'site')}),
26
27         (u'Informações da sede',
28          {'fields': ('local', 'nome_contato', 'endereco', 'cidade',
29                      'estado', 'telefone', 'info_adicional')}),
30     )
31
32     search_fields = list_display = 'nome', 'local'
33
34 class PalestranteAdmin(admin.ModelAdmin):
35     fieldsets = (
36         (None, {'fields': ('nome', 'email', 'instituicao',
37                            'minicurriculo', 'curriculo')}),
38
39         (u'Telefones', {'fields': ('telefone', 'celular')}),
40
41         (u'Endereço', {'fields': ('endereco', 'cep', 'cidade', 'estado')}),
42
43         (u'Avançado', {'fields': ('usuario',),
44                        'classes': 'collapse'}),
45     )
46
47     search_fields = list_display = 'nome', 'instituicao', 'email', 'celular'
48
49 class TipoTrabalhoAdmin(admin.ModelAdmin):
50     search_fields = 'nome',
51     list_filter = 'evento',
52
53 class TrilhaAdmin(admin.ModelAdmin):
54     search_fields = 'nome',
55     list_filter = 'evento',
56
57 class TrabalhoAdmin(admin.ModelAdmin):
58     list_filter = 'evento', 'tipo', 'trilha',
59     search_fields = list_display = 'titulo', 'evento', 'tipo'
60     
61 class DuracaoTrabalhoAdmin(admin.ModelAdmin):
62     search_fields = 'duracao', 'tipo',
63     list_filter = 'tipo',
64
65 class ImproveAdmin(admin.ModelAdmin):
66     pass
67
68 admin.site.register(Evento, EventoAdmin)    
69 admin.site.register(Palestrante, PalestranteAdmin)
70 admin.site.register(TipoTrabalho, TipoTrabalhoAdmin)
71 admin.site.register(Trilha, TrilhaAdmin)
72 admin.site.register(Trabalho, TrabalhoAdmin)
73 admin.site.register(DuracaoTrabalho, DuracaoTrabalhoAdmin)
74 admin.site.register(Improve, ImproveAdmin)