What is the max size of 'max_length' in Django?

前端 未结 4 1767
名媛妹妹
名媛妹妹 2021-02-01 00:31

This is my model:

class Position(models.Model):
    map = models.ForeignKey(Map,primary_key=True)
    #members=models.CharField(max_length=200)
    LatLng = mode         


        
4条回答
  •  不知归路
    2021-02-01 00:39

    It really depends on the database you use for the model. PostgreSQL, MySQL and so on have different settings and limits.

    If you really need a long string or not sure how long the variable would be, always safe to just go with variable=models.TextField().

提交回复
热议问题