Django for Designers: Difference between revisions

Content added Content deleted
imported>Paulproteus
(→‎Slicing and dicing Django data: Karen uses "" for strings, so I should, too.)
imported>Paulproteus
(Using "" for empty string, not '')
Line 734: Line 734:
url = models.URLField()
url = models.URLField()
timestamp = models.DateTimeField(auto_now_add=True)
timestamp = models.DateTimeField(auto_now_add=True)
title = models.CharField(max_length=200, blank=True, default='')
title = models.CharField(max_length=200, blank=True, default="")
</source>
</source>


Line 879: Line 879:
url = models.URLField()
url = models.URLField()
timestamp = models.DateTimeField(auto_now_add=True)
timestamp = models.DateTimeField(auto_now_add=True)
title = models.CharField(max_length=200, blank=True, default='')
title = models.CharField(max_length=200, blank=True, default="")


def __unicode__(self):
def __unicode__(self):
Line 1,040: Line 1,040:
class Bookmark(models.Model):
class Bookmark(models.Model):
author = models.ForeignKey(User)
author = models.ForeignKey(User)
title = models.CharField(max_length=200, blank=True, default='')
title = models.CharField(max_length=200, blank=True, default="")
url = models.URLField()
url = models.URLField()
timestamp = models.DateTimeField(auto_now_add=True)
timestamp = models.DateTimeField(auto_now_add=True)
Line 1,053: Line 1,053:
class Bookmark(models.Model):
class Bookmark(models.Model):
author = models.ForeignKey(User)
author = models.ForeignKey(User)
title = models.CharField(max_length=200, blank=True, default='')
title = models.CharField(max_length=200, blank=True, default="")
url = models.URLField()
url = models.URLField()
timestamp = models.DateTimeField(auto_now_add=True)
timestamp = models.DateTimeField(auto_now_add=True)