Mercurial > public > madeira
annotate mp3/models.py @ 91:c15b50f1ebfc
For Django 1.5: Don't include old photologue URLs.
They still use the old function style generic views, which are missing from
Django 1.5. Since I don't use these URLs, and at some point they broke in the
admin, just get rid of them for now.
author | Brian Neal <bgneal@gmail.com> |
---|---|
date | Tue, 27 Aug 2013 20:54:38 -0500 |
parents | e2868ad47a1e |
children |
rev | line source |
---|---|
bgneal@48 | 1 """ |
bgneal@48 | 2 Models for the mp3 application. |
bgneal@48 | 3 |
bgneal@48 | 4 """ |
bgneal@48 | 5 from django.db import models |
bgneal@48 | 6 |
bgneal@48 | 7 |
bgneal@48 | 8 class Collection(models.Model): |
bgneal@48 | 9 """ |
bgneal@48 | 10 This model represents a collection of songs. |
bgneal@48 | 11 |
bgneal@48 | 12 """ |
bgneal@48 | 13 title = models.CharField(max_length=64) |
bgneal@48 | 14 description = models.TextField() |
bgneal@48 | 15 date_added = models.DateTimeField() |
bgneal@48 | 16 |
bgneal@48 | 17 class Meta: |
bgneal@48 | 18 ordering = ['-date_added'] |
bgneal@48 | 19 |
bgneal@48 | 20 def __unicode__(self): |
bgneal@48 | 21 return self.title |
bgneal@48 | 22 |
bgneal@48 | 23 |
bgneal@48 | 24 class Song(models.Model): |
bgneal@48 | 25 """ |
bgneal@48 | 26 This model represents an uploaded song file. |
bgneal@48 | 27 |
bgneal@48 | 28 """ |
bgneal@48 | 29 title = models.CharField(max_length=64) |
bgneal@48 | 30 description = models.CharField(max_length=255, blank=True) |
bgneal@48 | 31 file = models.FileField(upload_to='mp3s/%Y/%m/%d/') |
bgneal@48 | 32 collection = models.ForeignKey(Collection) |
bgneal@48 | 33 |
bgneal@48 | 34 class Meta: |
bgneal@48 | 35 ordering = ['title'] |
bgneal@48 | 36 |
bgneal@48 | 37 def __unicode__(self): |
bgneal@48 | 38 return self.title |
bgneal@48 | 39 |