tags:

views:

102

answers:

1

this is my model:

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

but it can't run ..

thanks

+4  A: 

That depends on the database backend. The Django DB Docs will tell you, that max_length=255 is guaranteed to work always.

If you need something of the amount you've specified in your question, I'd suggest to use a TextField.

Haes
With this being the case coupled with the fact that for the DB I use it also limits the unique option to 255, I personally stick to the mantra that if I need a CharField that is bigger than 255 I make it a TextField.
digitaldreamer
what is the TextField 's max size ???
zjm1126
TextField's max size is also DB dependant. For MySQL, its somewhere around 4 trillion.
Justin Lilly