diff podcast/models.py @ 1032:e932f2ecd4a7

Django 1.8 warnings / tech debt cleanup.
author Brian Neal <bgneal@gmail.com>
date Sat, 26 Dec 2015 15:10:55 -0600
parents ee87ea74d46b
children
line wrap: on
line diff
--- a/podcast/models.py	Sun Dec 20 22:18:59 2015 -0600
+++ b/podcast/models.py	Sat Dec 26 15:10:55 2015 -0600
@@ -4,14 +4,15 @@
 """
 import datetime
 
+from django.core.urlresolvers import reverse
 from django.db import models
 
 
-EXPLICIT_CHOICES = (
-        ('yes', 'Yes'),
-        ('no', 'No'),
-        ('clean', 'Clean'),
-    )
+EXPLICIT_CHOICES = [
+    ('yes', 'Yes'),
+    ('no', 'No'),
+    ('clean', 'Clean'),
+]
 
 
 class Channel(models.Model):
@@ -53,15 +54,14 @@
     explicit = models.CharField(max_length=8, choices=EXPLICIT_CHOICES)
     update_date = models.DateTimeField(db_index=True, blank=True)
 
-    @models.permalink
     def get_absolute_url(self):
-        return ('podcast.views.detail', [str(self.id)])
+        return reverse('podcast-detail', args=[str(self.id)])
 
     def __unicode__(self):
         return self.title
 
     class Meta:
-        ordering = ('-pubdate', )
+        ordering = ['-pubdate']
         verbose_name = 'podcast'
         verbose_name_plural = 'podcasts'