0
I have an uppercase problem in Jango, in the following code, it works in the first form (name) and in the last form (organ), but in the intermediary forms it does not turn the letters sent in the bank into uppercase...
py.models
class Requerente(models.Model):
NACIONALIDADE = (
('BRASILEIRO', 'BRASILEIRO'),
('BRASILEIRA', 'BRASILEIRA'),
('ESTRANGEIRO', 'ESTRANGEIRO'),
('ESTRANGEIRA', 'ESTRANGEIRA'),
)
ESTADO_CIVIL = (
('CASADO', 'CASADO'),
('CASADA', 'CASADA'),
('SOLTEIRO', 'SOLTEIRO'),
('SOLTEIRA', 'SOLTEIRA'),
('DIVORCIADO', 'DIVORCIADO'),
('DIVORCIADA', 'DIVORCIADA'),
('VIÚVO', 'VIÚVO'),
('VIÚVA', 'VIÚVA'),
)
REGIME = (
('COMUNHAO DE BENS', 'COMUNHAO DE BENS'),
('COMUNHAO PARCIAL DE BENS', 'COMUNHAO PARCIAL DE BENS'),
('SEPARAÇÃO DE BENS', 'SEPARACAO DE BENS'),
)
nome = models.CharField(max_length=100)
nacionalidade = models.CharField(choices=NACIONALIDADE, max_length=50, null=True)
estado_civil = models.CharField(u'estado civil', max_length=50, choices=ESTADO_CIVIL, null=True)
nubente = models.CharField(max_length=100, null=True)
regime = models.CharField(u'regime', max_length=50, choices=REGIME, blank=True, null=True)
profissao = models.CharField(max_length=50, null=True)
rg = models.CharField(max_length=100, null=True)
orgao = models.CharField(max_length=50, null=True)
cpf = models.CharField(max_length=14, )
logradouro = models.ForeignKey(Logradouro, verbose_name=u'Rua, Av.')
numero = models.CharField(max_length=50, )
bairro = models.ForeignKey(Bairro, )
cidade = models.ForeignKey(Cidade)
telefone = models.CharField(max_length=20, blank=True, null=True)
celular = models.CharField(max_length=20, blank=True, null=True)
def __unicode__(self):
return self.nome
def save(self, force_insert=False, force_update=False):
self.nome = self.nome.upper()
super(Requerente, self).save(force_insert, force_update)
def save(self, force_insert=False, force_update=False):
self.nubente = self.nubente.upper()
super(Requerente, self).save(force_insert, force_update)
def save(self, force_insert=False, force_update=False):
self.profissao = self.profissao.upper()
super(Requerente, self).save(force_insert, force_update)
def save(self, force_insert=False, force_update=False):
self.orgao = self.orgao.upper()
super(Requerente, self).save(force_insert, force_update)
Thank you very much !!!
– Lucas Junior
@Lucasjunior Show!! Glad it worked out. Mark the answer as the correct one in case someone else has the same question.
– Marlysson