optional fields in django models -


i have following model in django.

class link(models.model):     name = models.charfield(max_length=100)     url = models.charfield(max_length=100)     tag = models.charfield(max_length=100)      def __unicode__(self):         return self.name 

i need url field optional. how do this?

add attribute blank=true. optionally, can make field nullable null=true.


Comments

Popular posts from this blog

php - Why I am getting the Error "Commands out of sync; you can't run this command now" -

ruby - Nesting modules inside of a Rails eninge gem -

Eclipse formatter for java ending braces -