Hello everyone.
I started to learn python and django and now I am building a small app so I can get used to them.
my first problem is that I've created a new model class Task with this structure:
name = models.CharField(max_length=100)
description = models.TextField
modified_at = models.DateTimeField(auto_now=True)
created_at = models.DateTimeField(auto_now_add=True)
and when I run manage.py makemigrations my migration file looks like this:
operations = [
migrations.CreateModel(
name='Task',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name', models.CharField(max_length=100)),
('modified_at', models.DateTimeField(auto_now=True)),
('created_at', models.DateTimeField(auto_now_add=True)),
],
),
]
the description field is skipped and I can't understand why.
Also if I try to add it manually like this: ('description', models.TextField),
when I run manage.py migrate I get this error: AttributeError: type object 'TextField' has no attribute 'is_relation'
can someone please tell me why this is happening? I am missing something? I am doing something wrong?