I have a registration class and a form for this, however I need to register each user using the user that the admin makes available, how do I do this? I have nothing on admin.py yet For example: when I click save I need to save the scholarship holder, etc ... How do I do? Would it have to have a class for each inheriting from admin sign-up and users?
from __future__ import unicode_literals
from django.db import models
from django.db import models
VINCULO = (
(u'1', u'Bolsista'),
(u'2', u'Estagiário'),
(u'3', u'Terceiro'),
(u'4', u'Servidor'),
(u'5', u'Aluno Pós-Graduação'),
(u'6', u'Servidor de outros órgãos'),
(u'7', u'Professor Colaborador'),
)
SALAS = (
(u'1', u'SysAdmin'),
(u'2', u'Help Desk'),
)
class Inscricao(models.Model):
vinculo = models.CharField(max_length=100, choices=VINCULO)
registro = models.IntegerField()
nome = models.CharField(max_length=100)
email_inpe = models.EmailField(blank=True)
email = models.EmailField(unique=True)
data_admissao = models.DateField()
data_fim_contrato = models.DateField()
sala = models.CharField(max_length=100, choices=SALAS)
ramal = models.CharField(max_length=30)
criado_em = models.DateTimeField('criado em', auto_now_add=True)
class Meta:
ordering = ['criado_em']
verbose_name = (u'nome')
verbose_name_plural = (u'nomes')
def __unicode__(self):
return self.nome