From: Lincoln de Sousa Date: Wed, 15 Aug 2007 22:51:12 +0000 (-0300) Subject: Escondendo as categorias para o usuário (palestrante) X-Git-Url: http://git.cascardo.eti.br/?p=cascardo%2Feventmanager.git;a=commitdiff_plain;h=f99f240a34a2def3ef0e2aa21c85a2399a067ae1 Escondendo as categorias para o usuário (palestrante) --- diff --git a/forms.py b/forms.py index ed5c3d7..e7ece08 100644 --- a/forms.py +++ b/forms.py @@ -1,4 +1,4 @@ -# -*- coding: utf8; -*- +# -*- coding: utf-8; -*- """ Copyright (C) 2007 Lincoln de Sousa @@ -28,9 +28,6 @@ class SubmeterTrabalho(forms.Form): def __init__(self, *args, **kwargs): super(SubmeterTrabalho, self).__init__(*args, **kwargs) - newchoices = MKCHOICES(CategoriaTrabalho) - self.fields['categoria'].choices = newchoices - newchoices = MKCHOICES(TipoTrabalho) self.fields['tipo'].choices = newchoices @@ -39,7 +36,6 @@ class SubmeterTrabalho(forms.Form): titulo = forms.CharField(max_length=100, label='Título do trabalho') tipo = forms.ChoiceField() - categoria = forms.ChoiceField() descricao_curta = forms.CharField(widget=Textarea(), label='Descrição curta', max_length=250, help_text='Esta descrição será utilizada para exibição no ' diff --git a/views.py b/views.py index 684e59f..4d9783a 100644 --- a/views.py +++ b/views.py @@ -1,4 +1,4 @@ -# -*- coding: utf8; -*- +# -*- coding: utf-8; -*- """ Copyright (C) 2007 Lincoln de Sousa @@ -147,7 +147,7 @@ def submeter_trabalho(request): t = Trabalho() t.titulo = cd['titulo'] t.tipo = TipoTrabalho.objects.get(pk=cd['tipo']) - t.categoria = CategoriaTrabalho.objects.get(pk=cd['categoria']) + t.categoria = CategoriaTrabalho.objects.get_or_create(nome='Pendente')[0] t.descricao_curta = cd['descricao_curta'] t.descricao_longa = cd['descricao_longa'] t.recursos = cd['recursos']