I'm trying to fill a field in my model with the current username in django 1.10.
This is the code that I'm using.
class Archivo(models.Model):
nombre = models.CharField(max_length = 30)
documento = models.FileField()
fecha_creacion = models.DateField(default = timezone.now)
observaciones = models.CharField(max_length = 20)
usuario = models.CharField(User.get_username())
transferencia = models.ForeignKey(User)
The field that I'm trying to fill is "usuario"
And I'm getting the next error:
TypeError: get_username() missing 1 required positional argument: 'self'
Am I doing this wrong? By the way, I am not using a view, I am trying to do this directly from the admin site.
I post this image as example that I'm trying to do, the field "Usuario" should be fill automatically with "ROBERTO"...