]> git.parisson.com Git - diggersdigest.git/commitdiff
Add Podcast model in records app
authorThomas Fillon <thomas@parisson.com>
Wed, 19 Aug 2015 16:21:12 +0000 (18:21 +0200)
committerThomas Fillon <thomas@parisson.com>
Wed, 19 Aug 2015 16:21:12 +0000 (18:21 +0200)
.dockerignore
.gitignore
diggersdigest/records/admin.py
diggersdigest/records/migrations/0003_podcast.py [new file with mode: 0644]
diggersdigest/records/models.py

index 563411e51dac22cbd11ceea084fae186f104a6d7..c73424275a6cc31da354bbd8ad05868e1198fe69 100644 (file)
@@ -1,2 +1,2 @@
 mysql/*
-static/*
\ No newline at end of file
+diggersdigest/static/*
\ No newline at end of file
index 6443386c174b0fc42d0308cdc5a00f6af5feb866..220c1aa7d60669635bef3ae00c7721bd2525ae37 100644 (file)
@@ -26,4 +26,5 @@ pip-log.txt
 #*.mo
 
 #Volume Directory for docker-compose
-mysql/
\ No newline at end of file
+mysql/
+diggersdigest/static/
\ No newline at end of file
index fd0f4357676c3a5b758647338477f3739e1b6d96..f476c371ec93de4f86424e553834236c860e8fe3 100644 (file)
@@ -13,7 +13,7 @@ from .models import Artist
 from .models import Label
 from .models import Country
 from .models import Record
-
+from .models import Podcast
 
     
 admin.site.register(Gallery)
@@ -28,3 +28,4 @@ admin.site.register(Artist)
 admin.site.register(Label)
 admin.site.register(Country)
 admin.site.register(Record)
+admin.site.register(Podcast)
diff --git a/diggersdigest/records/migrations/0003_podcast.py b/diggersdigest/records/migrations/0003_podcast.py
new file mode 100644 (file)
index 0000000..3530232
--- /dev/null
@@ -0,0 +1,27 @@
+# -*- coding: utf-8 -*-
+from __future__ import unicode_literals
+
+from django.db import models, migrations
+import mezzanine.core.fields
+
+
+class Migration(migrations.Migration):
+
+    dependencies = [
+        ('blog', '0002_auto_20150527_1555'),
+        ('records', '0002_artist_country_label_record'),
+    ]
+
+    operations = [
+        migrations.CreateModel(
+            name='Podcast',
+            fields=[
+                ('blogpost_ptr', models.OneToOneField(parent_link=True, auto_created=True, primary_key=True, serialize=False, to='blog.BlogPost')),
+                ('audio', mezzanine.core.fields.FileField(max_length=200, verbose_name='Audio File')),
+            ],
+            options={
+                'abstract': False,
+            },
+            bases=('blog.blogpost',),
+        ),
+    ]
index ea0f532cddb9d869c553ab7611ea66c368d87e12..be7ab1bd0a466423b061a9aeb4d6fb016685efea 100644 (file)
@@ -6,8 +6,11 @@ from django.utils.translation import ugettext_lazy as _
 from cartridge.shop.models import Product
 
 from mezzanine.core.fields import FileField
+from mezzanine.core.models import CONTENT_STATUS_DRAFT, CONTENT_STATUS_PUBLISHED
+from mezzanine.blog.models import BlogPost
 from mezzanine.utils.models import upload_to
 
+
 # Auto-generated Django models with manage.py inspectdb on the old database
 # You'll have to do the following manually to clean this up:
 #   * Make sure each model has one field with primary_key=True
@@ -61,7 +64,7 @@ class Link(models.Model):
         db_table = 'links'
 
     def __unicode__(self):
-        return self.titre
+        return self.adress
 
 
 class Mix(models.Model):
@@ -180,6 +183,7 @@ class Record(Product):
     # title --> shop.titre
     # categories --> shop.theme
     # price --> shop.prix
+    # status --> shop.published
     
     artiste = models.CharField(max_length=128)
     new = models.IntegerField()
@@ -190,8 +194,12 @@ class Record(Product):
     cover = models.IntegerField()  # TODO : choices=GRADINGS)
     vinyl = models.IntegerField()  # TODO : choices=GRADING)
     audio =  FileField(_("Audio File"), max_length=200, format="Audio",
-                            upload_to=upload_to("dig2site.Record.audio", "audio"))
+                        upload_to=upload_to("records.Record.audio", "audio/records"))
 
     def __unicode__(self):
         return " - ".join([self.artiste, self.title])
 
+
+class Podcast(BlogPost):
+    audio =  FileField(_("Audio File"), max_length=200, format="Audio",
+                       upload_to=upload_to("records.Podcast.audio", "audio/mixes"))