Reputation: 217
This is the model I have. I'm trying to make notes a textarea and when I try to makemigrations I get the module 'django.db.models has no attribute TextArea'
class Note(models.Model):
timestamp = models.DateTimeField()
notes = models.TextArea()
Not sure if i should use django.forms model on this, if so should i have two models, one for Note and another for NoteForms to handle the textarea field.
Upvotes: 1
Views: 3295
Reputation: 438
If you want to store multiline text then you can use TextField:
notes = models.TextField()
Upvotes: 0
Reputation: 1608
If you want to store variable length of text you can use
a = models.TextField()
.
Model Have no attribute TextArea(). If you know the maximum length of text that can be entered using text area then you can use CharField.
a = models.CharField(max_length=500)
Upvotes: 4