How do I add a field in Django model whose data type is set to text
text_field = models.CharField(max_length=max) can I do this? I am using postgresql 8.4.
开发者_Python百科Thanks
You want to use the type TextField. Like this:
text_field = models.TextField()
What you have there should do the trick. What issues are you seeing?
class MyModel(models.Model):
text = models.CharField(max_length=100)
If you're looking for a text blob, use:
text = models.TextField()
精彩评论