Can I have in Django's model a column of PostgreSQL's "text" type? If so, how can I do that?
You can use the TextField
A large text field. The default form widget for this field is a Textarea.
Usage:
class MyModel(models.Model):
text_field = models.TextField("My field label", null=True, blank=True)
If the text is not too long, You could also consider CharField
A string field, for small- to large-sized strings. For large amounts of text, use TextField.
The default form widget for this field is a TextInput.
Usage:
class MyModel(models.Model):
text_field = models.CharField("My field label", max_length=1024, null=True, blank=True)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With