comparison oembed/models.py @ 911:d3f6e9cb1f39

First take at an oembed refresh command.
author Brian Neal <bgneal@gmail.com>
date Tue, 17 Mar 2015 21:24:45 -0500
parents ee87ea74d46b
children 4da4e32b314c
comparison
equal deleted inserted replaced
910:90acb29478e9 911:d3f6e9cb1f39
45 height = models.IntegerField() 45 height = models.IntegerField()
46 html = models.TextField() 46 html = models.TextField()
47 date_added = models.DateTimeField() 47 date_added = models.DateTimeField()
48 48
49 def __unicode__(self): 49 def __unicode__(self):
50 return self.title or self.url 50 desc = self.title if self.title else self.url
51 return u"<oembed {}: {}>".format(self.pk, desc)
51 52
52 def save(self, *args, **kwargs): 53 def save(self, *args, **kwargs):
53 if not self.pk: 54 if not self.pk:
54 self.date_added = datetime.datetime.now() 55 self.date_added = datetime.datetime.now()
55 56