summaryrefslogtreecommitdiff
path: root/app/recordings
diff options
context:
space:
mode:
authorluxagraf <sng@luxagraf.net>2023-07-28 13:39:02 -0500
committerluxagraf <sng@luxagraf.net>2023-07-28 13:39:02 -0500
commit9a620cf42bf1fe6977e378bd834b41ff4a593dde (patch)
treecf41a0582681cecaf88a30bfe409f9c2be57972a /app/recordings
parent6e5897117124cd60ae81efb1574c6347f48e60e5 (diff)
main: removed some apps I wasn't using and added bak to git to preserve
a copy of old apps
Diffstat (limited to 'app/recordings')
-rw-r--r--app/recordings/__init__.py0
-rw-r--r--app/recordings/admin.py38
-rw-r--r--app/recordings/migrations/0001_initial.py34
-rw-r--r--app/recordings/migrations/0002_auto_20190325_1417.py26
-rw-r--r--app/recordings/migrations/__init__.py0
-rw-r--r--app/recordings/models.py71
6 files changed, 0 insertions, 169 deletions
diff --git a/app/recordings/__init__.py b/app/recordings/__init__.py
deleted file mode 100644
index e69de29..0000000
--- a/app/recordings/__init__.py
+++ /dev/null
diff --git a/app/recordings/admin.py b/app/recordings/admin.py
deleted file mode 100644
index d972497..0000000
--- a/app/recordings/admin.py
+++ /dev/null
@@ -1,38 +0,0 @@
-from django.contrib import admin
-from django.contrib.contenttypes.admin import GenericTabularInline
-
-from .models import Audio
-from utils.widgets import LGEntryForm, OLAdminBase
-from utils.util import get_latlon
-
-@admin.register(Audio)
-class NoteAdmin(OLAdminBase):
- form = LGEntryForm
- prepopulated_fields = {"slug": ('title',)}
- list_display = ('title', 'pub_date', 'location')
- fieldsets = (
- ('Note', {
- 'fields': (
- 'title',
- 'subtitle',
- 'body_markdown',
- 'slug',
- 'pub_date',
- ('mp3', 'ogg'),
- 'point'
- ),
- 'classes': (
- 'show',
- 'extrapretty',
- 'wide'
- )
- }
- ),
- )
- lat, lon = get_latlon()
- default_lon = lon
- default_lat = lat
- default_zoom = 10
-
- class Media:
- js = ('image-loader.js', 'next-prev-links.js')
diff --git a/app/recordings/migrations/0001_initial.py b/app/recordings/migrations/0001_initial.py
deleted file mode 100644
index d70b7dc..0000000
--- a/app/recordings/migrations/0001_initial.py
+++ /dev/null
@@ -1,34 +0,0 @@
-# Generated by Django 2.1.7 on 2019-03-25 14:12
-
-import datetime
-from django.db import migrations, models
-import recordings.models
-
-
-class Migration(migrations.Migration):
-
- initial = True
-
- dependencies = [
- ]
-
- operations = [
- migrations.CreateModel(
- name='Audio',
- fields=[
- ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
- ('title', models.CharField(max_length=200)),
- ('subtitle', models.CharField(blank=True, max_length=200)),
- ('slug', models.SlugField(blank=True, unique_for_date='pub_date')),
- ('body_html', models.TextField(blank=True)),
- ('body_markdown', models.TextField(blank=True)),
- ('pub_date', models.DateTimeField(default=datetime.datetime.now)),
- ('mp3', models.FileField(blank=True, null=True, upload_to=recordings.models.get_upload_path)),
- ('ogg', models.FileField(blank=True, null=True, upload_to=recordings.models.get_upload_path)),
- ],
- options={
- 'get_latest_by': 'pub_date',
- 'ordering': ('-pub_date',),
- },
- ),
- ]
diff --git a/app/recordings/migrations/0002_auto_20190325_1417.py b/app/recordings/migrations/0002_auto_20190325_1417.py
deleted file mode 100644
index d5193d3..0000000
--- a/app/recordings/migrations/0002_auto_20190325_1417.py
+++ /dev/null
@@ -1,26 +0,0 @@
-# Generated by Django 2.1.7 on 2019-03-25 14:17
-
-import django.contrib.gis.db.models.fields
-from django.db import migrations, models
-import django.db.models.deletion
-
-
-class Migration(migrations.Migration):
-
- dependencies = [
- ('locations', '0017_auto_20190217_1849'),
- ('recordings', '0001_initial'),
- ]
-
- operations = [
- migrations.AddField(
- model_name='audio',
- name='location',
- field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='locations.Location'),
- ),
- migrations.AddField(
- model_name='audio',
- name='point',
- field=django.contrib.gis.db.models.fields.PointField(blank=True, null=True, srid=4326),
- ),
- ]
diff --git a/app/recordings/migrations/__init__.py b/app/recordings/migrations/__init__.py
deleted file mode 100644
index e69de29..0000000
--- a/app/recordings/migrations/__init__.py
+++ /dev/null
diff --git a/app/recordings/models.py b/app/recordings/models.py
deleted file mode 100644
index 8da5c36..0000000
--- a/app/recordings/models.py
+++ /dev/null
@@ -1,71 +0,0 @@
-import datetime
-from django.contrib.gis.db import models
-from django import forms
-from django.urls import reverse
-from django.apps import apps
-
-from utils.util import render_images, markdown_to_html
-
-from locations.models import Location, CheckIn
-
-
-def get_upload_path(self, filename):
- return "audio/%s/%s" % (datetime.datetime.today().strftime("%Y"), filename)
-
-
-class Audio(models.Model):
- title = models.CharField(max_length=200)
- subtitle = models.CharField(max_length=200, blank=True)
- slug = models.SlugField(unique_for_date='pub_date', blank=True)
- body_html = models.TextField(blank=True)
- body_markdown = models.TextField(blank=True)
- pub_date = models.DateTimeField(default=datetime.datetime.now)
- mp3 = models.FileField(blank=True, null=True, upload_to=get_upload_path)
- ogg = models.FileField(blank=True, null=True, upload_to=get_upload_path)
- point = models.PointField(blank=True, null=True)
- location = models.ForeignKey(Location, on_delete=models.CASCADE, blank=True, null=True)
-
- class Meta:
- ordering = ('-pub_date',)
- get_latest_by = 'pub_date'
-
- def __str__(self):
- return self.title
-
- def get_absolute_url(self):
- return reverse("prompt:detail", kwargs={"slug": self.slug})
-
- @property
- def get_previous_published(self):
- return self.get_previous_by_pub_date(status__exact=1)
-
- @property
- def get_previous_admin_url(self):
- n = self.get_previous_by_pub_date()
- return reverse('admin:%s_%s_change' % (self._meta.app_label, self._meta.model_name), args=[n.id])
-
- @property
- def get_next_published(self):
- return self.get_next_by_pub_date(status__exact=1)
-
- @property
- def get_next_admin_url(self):
- model = apps.get_model(app_label=self._meta.app_label, model_name=self._meta.model_name)
- try:
- return reverse('admin:%s_%s_change' % (self._meta.app_label, self._meta.model_name), args=[self.get_next_by_pub_date().pk])
- except model.DoesNotExist:
- return ''
-
- def get_type(self):
- return str(self.__class__.__name__)
-
- def save(self, *args, **kwargs):
- md = render_images(self.body_markdown)
- self.body_html = markdown_to_html(md)
- if not self.point:
- self.point = CheckIn.objects.latest().point
- try:
- self.location = Location.objects.filter(geometry__contains=self.point).get()
- except Location.DoesNotExist:
- raise forms.ValidationError("There is no location associated with that point, add it: %sadmin/locations/location/add/" % (settings.BASE_URL))
- super(Audio, self).save(*args, **kwargs)