Commits

Francisco Souza  committed 1184d0a

Ajustes nos textos de exibição da tela de administração.

  • Participants
  • Parent commits 5135394

Comments (0)

Files changed (2)

File cursos/admin.py

 from django.contrib import admin
 from django.contrib.admin.options import ModelAdmin
-from models import Aluno, Instrutor, Inscricao, Telefone, Curso, Material
+from models import Aluno, Instrutor, Inscricao, Telefone, Curso
 
 class CursoAdmin(ModelAdmin):
     list_display = ('titulo', 'carga_horaria',)
 admin.site.register(Inscricao)
 admin.site.register(Telefone)
 admin.site.register(Curso, CursoAdmin)
-admin.site.register(Material)

File cursos/models.py

+#coding:utf-8
 from django.db import models
 from django.core.urlresolvers import reverse
 from django.contrib.auth.models import User
 from util.signals import curso_pre_save, instrutor_pre_save
 from django.db.models import signals
+from django.utils.translation import gettext_lazy
 
 # Create your models here.
 class Instrutor(models.Model):
+    class Meta:
+        ordering = ('nome',)
+        verbose_name = gettext_lazy('Instrutor')
+        verbose_name_plural = gettext_lazy('Instrutores')
+
     nome = models.CharField(max_length = 200)
     descricao = models.TextField()
     slug = models.SlugField(max_length = 100, blank = True, unique = True)
         return self.nome
 
 class Curso(models.Model):
+    class Meta:
+        ordering = ('titulo',)
+        verbose_name = gettext_lazy('Curso')
+        verbose_name_plural = gettext_lazy('Cursos')
+
     titulo = models.CharField(max_length = 300)
     descricao = models.TextField()
     carga_horaria = models.IntegerField()
     def __unicode__(self):
         return self.titulo
 
-class Material(models.Model):
-    arquivo = models.FileField(upload_to = 'cursos/materiais')
-    curso = models.ForeignKey('Curso')
+class Aluno(User):
+    class Meta:
+        ordering = ('first_name', 'username',)
+        verbose_name = gettext_lazy('Aluno')
+        verbose_name_plural = gettext_lazy('Alunos')
 
-class Aluno(User):
     cpf = models.CharField(max_length = 11)
 
     def __unicode__(self):
         return self.username
 
 class Telefone(models.Model):
+    class Meta:
+        verbose_name = gettext_lazy('Telefone')
+        verbose_name_plural = gettext_lazy('Telefones')
+
     ddd = models.CharField(max_length = 2)
     numero = models.CharField(max_length = 8)
     proprietario = models.ForeignKey('Aluno')
         return '(%s) %s' % (self.ddd, self.numero)
 
 class Inscricao(models.Model):
+    class Meta:
+        verbose_name = gettext_lazy('Inscrição')
+        verbose_name_plural = gettext_lazy('Inscrições')
+
+
     status = models.BooleanField()
     aluno = models.ForeignKey('Aluno')
     curso = models.ForeignKey('Curso')