I have a table in postgres with a column description
that had the type varchar(2000)
, so in django:
description = serializers.CharField(......., max_length = 2000)
I want to change the description
column in postgres to type text
Can I leave the description
as a charfield
? Or do I have to change it to a textfield
? I still want to have max_length
specified but change it to 5000, ie:
description = serializers.CharField(......., max_length = 5000)
I've tried to read the docs: https://www.django-rest-framework.org/api-guide/fields/#charfield, but I didn't see it being stated explicitly.
From what I've seen, it says:
CharField corresponds to django.db.models.fields.CharField or django.db.models.fields.TextField
I'm guessing that means it's ok?
I also looked around on stackoverflow: What's the difference between CharField and TextField in Django?, but I didn't see it being stated explicitly either.