Commit 7a48ff11 authored by fred's avatar fred

emissions: add a proper duration field

parent 6991314e
# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'Emission.duration'
db.add_column(u'emissions_emission', 'duration',
self.gf('django.db.models.fields.IntegerField')(default=60),
keep_default=False)
def backwards(self, orm):
# Deleting field 'Emission.duration'
db.delete_column(u'emissions_emission', 'duration')
models = {
u'emissions.category': {
'Meta': {'object_name': 'Category'},
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'title': ('django.db.models.fields.CharField', [], {'max_length': '50'})
},
u'emissions.diffusion': {
'Meta': {'object_name': 'Diffusion'},
'datetime': ('django.db.models.fields.DateTimeField', [], {}),
'episode': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['emissions.Episode']"}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'})
},
u'emissions.emission': {
'Meta': {'object_name': 'Emission'},
'archived': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'categories': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['emissions.Category']", 'symmetrical': 'False'}),
'description': ('ckeditor.fields.RichTextField', [], {'null': 'True', 'blank': 'True'}),
'duration': ('django.db.models.fields.IntegerField', [], {'default': '60'}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'slug': ('django.db.models.fields.SlugField', [], {'max_length': '50'}),
'text': ('ckeditor.fields.RichTextField', [], {'null': 'True'}),
'title': ('django.db.models.fields.CharField', [], {'max_length': '50'})
},
u'emissions.episode': {
'Meta': {'object_name': 'Episode'},
'description': ('ckeditor.fields.RichTextField', [], {'null': 'True', 'blank': 'True'}),
'emission': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['emissions.Emission']"}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'slug': ('django.db.models.fields.SlugField', [], {'max_length': '50'}),
'text': ('ckeditor.fields.RichTextField', [], {'null': 'True'}),
'title': ('django.db.models.fields.CharField', [], {'max_length': '50'})
},
u'emissions.schedule': {
'Meta': {'object_name': 'Schedule'},
'datetime': ('django.db.models.fields.DateTimeField', [], {}),
'emission': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['emissions.Emission']"}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'rerun': ('django.db.models.fields.BooleanField', [], {'default': 'False'})
},
u'emissions.soundfile': {
'Meta': {'object_name': 'SoundFile'},
'episode': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['emissions.Episode']"}),
'file': ('django.db.models.fields.files.FileField', [], {'max_length': '250'}),
'fragment': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'podcastable': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'title': ('django.db.models.fields.CharField', [], {'max_length': '50'})
}
}
complete_apps = ['emissions']
\ No newline at end of file
......@@ -29,7 +29,7 @@ class Emission(models.Model):
categories = models.ManyToManyField(Category)
#langs? (HOW? Must be an array of multiples choices!)
duration = 60
duration = models.IntegerField(default=60)
def get_absolute_url(self):
return reverse('emission-view', kwargs={'slug': str(self.slug)})
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment