I managed to solve this problem :)
In the model class instead of description = models.TextField I must write 
description = models.TextField(), I forgot the parentheses.

On Sunday, October 9, 2016 at 3:39:10 PM UTC+3, Bogdan P. wrote:
>
> 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?
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/3b6689c1-141c-4989-a66b-141e761304d2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to