summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlxf <sng@luxagraf.net>2019-05-25 15:10:38 +0000
committerlxf <sng@luxagraf.net>2019-05-25 15:10:38 +0000
commitdd09ca3810ea0798899870930c3efb388b776a7c (patch)
tree0cf0f8ba6c44b774a0867f48fce9cafb96620974
parentfc037fa9bf0eee9920ae1da14ce80d594f39cba4 (diff)
made some changes to use new checkin model
-rw-r--r--app/builder/views.py1
-rw-r--r--app/essays/migrations/0006_remove_essay_has_video.py17
-rw-r--r--app/essays/migrations/0007_essay_has_video.py18
-rw-r--r--app/essays/migrations/0008_merge_20190303_1638.py14
-rw-r--r--app/essays/migrations/0009_merge_20190414_1500.py14
-rw-r--r--app/jrnl/build.py3
-rw-r--r--app/links/forms.py1
-rw-r--r--app/locations/models.py9
-rw-r--r--app/photos/models.py1
-rw-r--r--app/sightings/models.py9
-rw-r--r--app/unused_apps/figments/admin.py (renamed from app/figments/admin.py)0
-rw-r--r--app/unused_apps/figments/build.py (renamed from app/figments/build.py)0
-rw-r--r--app/unused_apps/figments/ebook.py (renamed from app/figments/ebook.py)0
-rw-r--r--app/unused_apps/figments/models.py (renamed from app/figments/models.py)0
-rw-r--r--app/unused_apps/figments/urls.py (renamed from app/figments/urls.py)0
-rw-r--r--app/unused_apps/figments/views.py (renamed from app/figments/views.py)0
-rw-r--r--app/utils/util.py7
17 files changed, 82 insertions, 12 deletions
diff --git a/app/builder/views.py b/app/builder/views.py
index c0bb5c0..ca4a876 100644
--- a/app/builder/views.py
+++ b/app/builder/views.py
@@ -7,7 +7,6 @@ from resume.build import pub_builder, resume_builder
from books.build import builder as book_builder
from sightings.build import builder as sightings_builder
from photos.build import builder as photo_builder
-from figments.build import builder as figments_builder
from notes.build import builder as notes_builder
from pages.build import builder as page_builder
from fieldnotes.build import builder as fieldnotes_builder
diff --git a/app/essays/migrations/0006_remove_essay_has_video.py b/app/essays/migrations/0006_remove_essay_has_video.py
new file mode 100644
index 0000000..0842d8b
--- /dev/null
+++ b/app/essays/migrations/0006_remove_essay_has_video.py
@@ -0,0 +1,17 @@
+# Generated by Django 2.1.2 on 2019-02-27 21:22
+
+from django.db import migrations
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ('essays', '0005_auto_20190208_0946'),
+ ]
+
+ operations = [
+ migrations.RemoveField(
+ model_name='essay',
+ name='has_video',
+ ),
+ ]
diff --git a/app/essays/migrations/0007_essay_has_video.py b/app/essays/migrations/0007_essay_has_video.py
new file mode 100644
index 0000000..0057e95
--- /dev/null
+++ b/app/essays/migrations/0007_essay_has_video.py
@@ -0,0 +1,18 @@
+# Generated by Django 2.1.2 on 2019-02-27 21:22
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ('essays', '0006_remove_essay_has_video'),
+ ]
+
+ operations = [
+ migrations.AddField(
+ model_name='essay',
+ name='has_video',
+ field=models.BooleanField(blank=True, default=False),
+ ),
+ ]
diff --git a/app/essays/migrations/0008_merge_20190303_1638.py b/app/essays/migrations/0008_merge_20190303_1638.py
new file mode 100644
index 0000000..7c155d8
--- /dev/null
+++ b/app/essays/migrations/0008_merge_20190303_1638.py
@@ -0,0 +1,14 @@
+# Generated by Django 2.1.2 on 2019-03-03 16:38
+
+from django.db import migrations
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ('essays', '0007_essay_has_video'),
+ ('essays', '0006_auto_20190303_1625'),
+ ]
+
+ operations = [
+ ]
diff --git a/app/essays/migrations/0009_merge_20190414_1500.py b/app/essays/migrations/0009_merge_20190414_1500.py
new file mode 100644
index 0000000..83a8323
--- /dev/null
+++ b/app/essays/migrations/0009_merge_20190414_1500.py
@@ -0,0 +1,14 @@
+# Generated by Django 2.1.2 on 2019-04-14 15:00
+
+from django.db import migrations
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ('essays', '0008_merge_20190303_1638'),
+ ('essays', '0007_auto_20190414_1455'),
+ ]
+
+ operations = [
+ ]
diff --git a/app/jrnl/build.py b/app/jrnl/build.py
index 0b3826a..dcebace 100644
--- a/app/jrnl/build.py
+++ b/app/jrnl/build.py
@@ -46,13 +46,14 @@ class BuildJrnl(BuildNew):
status__exact=1,
location__state__country__lux_region=c.id
)
+ print(c)
pages = self.get_pages(qs, 24)
for page in range(pages):
base_path = reverse("jrnl:list_country", kwargs={'slug': c.slug, 'page': page + 1})
response = self.client.get(base_path)
print(response.content)
if page == 0:
- self.write_file(base_path[:-2], response.content)
+ self.write_file(base_path, response.content)
else:
self.write_file(base_path, response.content)
diff --git a/app/links/forms.py b/app/links/forms.py
index b7a2343..8755401 100644
--- a/app/links/forms.py
+++ b/app/links/forms.py
@@ -1,4 +1,3 @@
from django import forms
from .models import Link
-from dal import autocomplete
diff --git a/app/locations/models.py b/app/locations/models.py
index 6e8db7c..50fda3d 100644
--- a/app/locations/models.py
+++ b/app/locations/models.py
@@ -245,10 +245,11 @@ class LuxCheckIn(models.Model):
return self.point.y
def save(self):
- 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))
+ if not self.location:
+ 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))
self.location_name = self.location.name
self.state_name = self.location.state.name
self.country_name = self.location.state.country.name
diff --git a/app/photos/models.py b/app/photos/models.py
index df8eac4..fd924f3 100644
--- a/app/photos/models.py
+++ b/app/photos/models.py
@@ -39,6 +39,7 @@ class LuxImageSize(models.Model):
quality = models.IntegerField()
class Meta:
+ ordering = ('-name', 'id')
verbose_name_plural = 'Image Sizes'
def __str__(self):
diff --git a/app/sightings/models.py b/app/sightings/models.py
index 3852b1c..7527615 100644
--- a/app/sightings/models.py
+++ b/app/sightings/models.py
@@ -198,9 +198,12 @@ class Sighting(models.Model):
if not self.point:
self.point = Sighting.objects.latest().point
try:
- self.location = Location.objects.filter(
- geometry__contains=self.point
- ).get()
+ self.location = Location.objects.filter(geometry__contains=self.point).get()
+ except Location.MultipleObjectsReturned:
+ for l in Location.objects.filter(geometry__contains=self.point):
+ if l.parent:
+ self.location = l
+ break
except Location.DoesNotExist:
raise forms.ValidationError("There is no location associated with that point, add it: %sadmin/locations/location/add/" % (settings.BASE_URL))
self.ap_common_name = self.ap.common_name
diff --git a/app/figments/admin.py b/app/unused_apps/figments/admin.py
index 34452bd..34452bd 100644
--- a/app/figments/admin.py
+++ b/app/unused_apps/figments/admin.py
diff --git a/app/figments/build.py b/app/unused_apps/figments/build.py
index b656ab0..b656ab0 100644
--- a/app/figments/build.py
+++ b/app/unused_apps/figments/build.py
diff --git a/app/figments/ebook.py b/app/unused_apps/figments/ebook.py
index 81210a4..81210a4 100644
--- a/app/figments/ebook.py
+++ b/app/unused_apps/figments/ebook.py
diff --git a/app/figments/models.py b/app/unused_apps/figments/models.py
index 8b22049..8b22049 100644
--- a/app/figments/models.py
+++ b/app/unused_apps/figments/models.py
diff --git a/app/figments/urls.py b/app/unused_apps/figments/urls.py
index 4a37cf5..4a37cf5 100644
--- a/app/figments/urls.py
+++ b/app/unused_apps/figments/urls.py
diff --git a/app/figments/views.py b/app/unused_apps/figments/views.py
index 6521c29..6521c29 100644
--- a/app/figments/views.py
+++ b/app/unused_apps/figments/views.py
diff --git a/app/utils/util.py b/app/utils/util.py
index 1779baa..b765e78 100644
--- a/app/utils/util.py
+++ b/app/utils/util.py
@@ -35,7 +35,7 @@ def convertll(lat, lon):
def get_latlon():
- loc = apps.get_model('locations', 'CheckIn').objects.latest()
+ loc = apps.get_model('locations', 'LuxCheckIn').objects.latest()
lat_converted, lon_converted = convertll(loc.lat, loc.lon)
return lat_converted, lon_converted
@@ -55,8 +55,11 @@ def parse_image(s):
for img in soup.find_all('img'):
try:
cl = img['class']
- if cl[0] == 'postpic' or cl[0] == 'postpicright':
+ #if cl[0] == 'postpic' or cl[0] == 'postpicright':
+ replacer = "[[base_url]]"
+ if replacer in str(img):
s = str(img).replace('[[base_url]]', settings.IMAGES_URL)
+ print(s)
return s
else:
try: