From f99f240a34a2def3ef0e2aa21c85a2399a067ae1 Mon Sep 17 00:00:00 2001 From: Lincoln de Sousa Date: Wed, 15 Aug 2007 19:51:12 -0300 Subject: [PATCH] =?utf8?q?Escondendo=20as=20categorias=20para=20o=20usu?= =?utf8?q?=C3=A1rio=20(palestrante)?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- forms.py | 6 +----- views.py | 4 ++-- 2 files changed, 3 insertions(+), 7 deletions(-) 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'] -- 2.20.1