mirror of
https://github.com/TrentSPalmer/trentpalmerdotorg.git
synced 2024-12-22 13:02:49 -08:00
add license/attribution info for episode images
This commit is contained in:
parent
4eabd16fa8
commit
f83c931d19
@ -24,5 +24,8 @@ class EpisodeForm(forms.ModelForm):
|
||||
model = Episode
|
||||
fields = [
|
||||
'title', 'author', 'pub_date', 'episode_number',
|
||||
'description', 'image', 'mp3'
|
||||
'description', 'mp3',
|
||||
'image_title', 'image_attribution', 'image_attribution_url',
|
||||
'original_image_url', 'image_license',
|
||||
'image_license_jurisdiction', 'image'
|
||||
]
|
||||
|
43
audio/migrations/0015_auto_20210316_1440.py
Normal file
43
audio/migrations/0015_auto_20210316_1440.py
Normal file
@ -0,0 +1,43 @@
|
||||
# Generated by Django 3.1.7 on 2021-03-16 21:40
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('audio', '0014_auto_20210316_1230'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='episode',
|
||||
name='image_attribution',
|
||||
field=models.CharField(default='', max_length=255),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='episode',
|
||||
name='image_attribution_url',
|
||||
field=models.URLField(blank=True, max_length=255),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='episode',
|
||||
name='image_license',
|
||||
field=models.SmallIntegerField(choices=[(1, 'Public Domain'), (2, 'Unknown'), (3, 'CC BY-SA 2.5'), (4, 'CC BY-SA 3.0'), (5, 'CC BY 3.0')], default=2),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='episode',
|
||||
name='image_license_jurisdiction',
|
||||
field=models.TextField(default=''),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='episode',
|
||||
name='image_title',
|
||||
field=models.CharField(default='', max_length=255),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='episode',
|
||||
name='original_image_url',
|
||||
field=models.URLField(default='', max_length=255),
|
||||
),
|
||||
]
|
@ -70,6 +70,25 @@ class Episode(UUIDAsIDModel):
|
||||
storage=PublicImageStorage(),
|
||||
upload_to=slugify_file_name,
|
||||
null=True, blank=True)
|
||||
|
||||
image_license = models.SmallIntegerField(
|
||||
choices=LICENSE_CHOICES,
|
||||
default=2,
|
||||
)
|
||||
image_title = models.CharField(max_length=255, default='')
|
||||
image_attribution = models.CharField(max_length=255, default='')
|
||||
image_attribution_url = models.URLField(max_length=255, blank=True)
|
||||
original_image_url = models.URLField(max_length=255, default='')
|
||||
image_license_jurisdiction = models.TextField(null=False, default='')
|
||||
|
||||
@property
|
||||
def image_license_name(self):
|
||||
return(get_image_license_info(self.image_license))[0]
|
||||
|
||||
@property
|
||||
def image_license_url(self):
|
||||
return(get_image_license_info(self.image_license))[1]
|
||||
|
||||
mp3 = models.FileField(
|
||||
storage=PublicMP3Storage(),
|
||||
upload_to=slugify_file_name,
|
||||
|
Loading…
Reference in New Issue
Block a user