summaryrefslogtreecommitdiff
path: root/app/sightings
diff options
context:
space:
mode:
authorluxagraf <sng@luxagraf.net>2020-12-02 12:41:14 -0500
committerluxagraf <sng@luxagraf.net>2020-12-02 12:41:14 -0500
commit8b2b5dec69a1d5d3c9e19c5eda48d1d6f706f9b4 (patch)
tree8ef75a6df028cdf04b2ad603cfd92a587049b15b /app/sightings
parentd4e55690d3293f375cb207693e9b02b39b4a940e (diff)
ready to get rid of photos model for media model
Diffstat (limited to 'app/sightings')
-rw-r--r--app/sightings/admin.py10
-rw-r--r--app/sightings/migrations/0001_initial.py1
-rw-r--r--app/sightings/migrations/0005_auto_20180516_1759.py3
-rw-r--r--app/sightings/migrations/0006_auto_20180707_0958.py2
-rw-r--r--app/sightings/models.py4
5 files changed, 4 insertions, 16 deletions
diff --git a/app/sightings/admin.py b/app/sightings/admin.py
index f6ec2af..0505ac8 100644
--- a/app/sightings/admin.py
+++ b/app/sightings/admin.py
@@ -3,20 +3,10 @@ from django.contrib import admin
from django.contrib.gis.admin import OSMGeoAdmin
from .models import APClass, AP, Sighting, FieldNote
-from photos.forms import GalleryForm
from utils.util import get_latlon
from utils.widgets import CustomSelectMultiple, LGEntryForm
from django.contrib.admin.options import FORMFIELD_FOR_DBFIELD_DEFAULTS
-class GalleryFormPlus(GalleryForm):
- def __init__(self, *args, **kwargs):
- super(GalleryFormPlus, self).__init__(*args, **kwargs)
- self.base_fields['seen_by'].widget = CustomSelectMultiple()
-
- class Meta:
- model = Sighting
- fields = '__all__'
-
@admin.register(APClass)
class APClassAdmin(admin.ModelAdmin):
diff --git a/app/sightings/migrations/0001_initial.py b/app/sightings/migrations/0001_initial.py
index 4c25926..f1f0c07 100644
--- a/app/sightings/migrations/0001_initial.py
+++ b/app/sightings/migrations/0001_initial.py
@@ -14,7 +14,6 @@ class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
- ('photos', '0018_auto_20161130_1218'),
('locations', '0002_checkin'),
]
diff --git a/app/sightings/migrations/0005_auto_20180516_1759.py b/app/sightings/migrations/0005_auto_20180516_1759.py
index 301c0d9..079ce03 100644
--- a/app/sightings/migrations/0005_auto_20180516_1759.py
+++ b/app/sightings/migrations/0005_auto_20180516_1759.py
@@ -7,7 +7,6 @@ import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
- ('photos', '0018_auto_20161130_1218'),
('sightings', '0004_ap_main_image'),
]
@@ -19,6 +18,6 @@ class Migration(migrations.Migration):
migrations.AddField(
model_name='ap',
name='image',
- field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='photos.LuxImage'),
+ field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='media.LuxImage'),
),
]
diff --git a/app/sightings/migrations/0006_auto_20180707_0958.py b/app/sightings/migrations/0006_auto_20180707_0958.py
index 9c146ed..6bdab4b 100644
--- a/app/sightings/migrations/0006_auto_20180707_0958.py
+++ b/app/sightings/migrations/0006_auto_20180707_0958.py
@@ -14,6 +14,6 @@ class Migration(migrations.Migration):
migrations.AlterField(
model_name='ap',
name='image',
- field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='photos.LuxImage'),
+ field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='media.LuxImage'),
),
]
diff --git a/app/sightings/models.py b/app/sightings/models.py
index 2a14e85..b54be12 100644
--- a/app/sightings/models.py
+++ b/app/sightings/models.py
@@ -12,7 +12,7 @@ from django.conf import settings
from bs4 import BeautifulSoup
from locations.models import Location
-from photos.models import LuxImage, LuxImageSize
+from media.models import LuxImage, LuxImageSize
from utils.next_prev import next_in_order, prev_in_order
from utils.util import render_images, extract_main_image, markdown_to_html
@@ -186,7 +186,7 @@ class Sighting(models.Model):
for img in self.images.all():
for size in img.sizes.all():
if size.width > 360 and size.width < 700:
- return img.get_image_by_size(size)
+ return img.get_image_url_by_size(size)
def get_absolute_url(self):
return reverse("sightings:detail", kwargs={"slug": self.ap.slug})