I have some classes, among them the following:
class Processo(models.Model):
TIPO_PROCESSO = (
('NORMAL', 'NORMAL'),
('TRANSMUTACAO', 'TRANSMUTACAO'),
('2a VIA', '2a VIA'),
)
usuario = models.ForeignKey(User, blank=True)
processo = models.CharField(max_length=50, unique=True)
requerente = models.ForeignKey(Requerente, )
requerentes_adicionais = models.ManyToManyField(Requerente, blank=True, default=None, related_name="requerentes_adicionais")
data_processo = models.DateField(u'data do processo')
#mesano = models.CharField(max_length=50, )
tipo = models.CharField(choices=TIPO_PROCESSO, max_length=50, default='NORMAL')
#situacao = models.CharField(max_length=50, ) / obsoleto, nao e mais necessario
def __unicode__(self):
return self.processo
I would like to know how to get the html code of this class, which is rendered on the page. I saw somewhere that is done by the python interpreter, something like > > > print form.as_p. The purpose is that I want to override the default admin, add more fields that are not in the database, to perform some tasks (eg, two fields, a numeric and a select, and the join of these two will generate the third field that is the process number, this done in javascript)