I have one Django model field definition like this:
landMark = models.CharField(max_length=50, blank=True)
Can I define the landMark field dynamically so that it is capable of holding a string which has a varying size ?
In a way, you already have. The field you have declared is capable of storing a string of any length, as long as it does not exceed 50 characters.
Now, if you want to be able to store an unlimited amount of characters, you can also use a TextField. For example:
landMark = models.TextField(blank=True)
No you can't. The length of string that can be accepted relies on the structure of your database -> you'd have to migrate your database on every max_length change! The solution to your problem would be to simply measure a potential maximum size of variable you'd like to save (here I think about some dev environment). Then set max_length accordingly.
landMarkcan already handle strings of varying size, up to a maximum length of 50 characters. Are you asking how to remove the upper limit entirely?