Package madrona :: Package screencasts :: Module models
[hide private]

Source Code for Module madrona.screencasts.models

 1  from django.contrib.gis.db import models 
 2  from django.conf import settings 
 3   
4 -class Screencast(models.Model):
5 video = models.FileField(upload_to=settings.SCREENCASTS) 6 image = models.ImageField(upload_to=settings.SCREENCAST_IMAGES) 7 title = models.CharField(max_length=100) 8 urlname = models.CharField(max_length=100) 9 description = models.CharField(max_length=350) 10 selected_for_help = models.BooleanField(default=False, help_text="Display this screencast on the main help page?") 11 IMPORTANCE_CHOICES = ( 12 (1,'1'), 13 (2,'2'), 14 (3,'3'), 15 (4,'4'), 16 (5,'5'), 17 (6,'6'), 18 (7,'7'), 19 (8,'8'), 20 (9,'9'), 21 (10,'10') 22 ) 23 importance = models.IntegerField(choices=IMPORTANCE_CHOICES, blank=True, null=True) 24
25 - class Meta:
26 db_table = 'mm_screencast'
27
28 - def __unicode__(self):
29 return self.title
30 31
32 -class YoutubeScreencast(models.Model):
33 youtube_id = models.CharField(max_length=24, unique=True, help_text="Youtube video id (hint: http://www.youtube.com/watch?v=<YOUTUBE_VIDEO_ID>)") 34 image = models.ImageField(upload_to=settings.SCREENCAST_IMAGES) 35 title = models.CharField(max_length=100) 36 description = models.CharField(max_length=350) 37 selected_for_help = models.BooleanField(default=False, help_text="Display this screencast on the main help page?") 38 IMPORTANCE_CHOICES = ( 39 (1,'1'), 40 (2,'2'), 41 (3,'3'), 42 (4,'4'), 43 (5,'5'), 44 (6,'6'), 45 (7,'7'), 46 (8,'8'), 47 (9,'9'), 48 (10,'10') 49 ) 50 importance = models.IntegerField(choices=IMPORTANCE_CHOICES, blank=True, null=True) 51 video_width = models.IntegerField(default=853) 52 video_height = models.IntegerField(default=505) 53 play_hd = models.BooleanField(default=True) 54
55 - def __unicode__(self):
56 return self.title
57