David Ramirez
David Ramirez

Reputation: 217

module 'django.db.models' has no attribute 'TextArea'

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

Answers (2)

Bharat Jogdand
Bharat Jogdand

Reputation: 438

If you want to store multiline text then you can use TextField:

notes = models.TextField()

Upvotes: 0

a_k_v
a_k_v

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

Related Questions