summaryrefslogtreecommitdiff
path: root/app/jrnl
diff options
context:
space:
mode:
Diffstat (limited to 'app/jrnl')
-rw-r--r--app/jrnl/admin.py2
-rw-r--r--app/jrnl/migrations/0017_entry_field_notes.py19
-rw-r--r--app/jrnl/models.py2
3 files changed, 23 insertions, 0 deletions
diff --git a/app/jrnl/admin.py b/app/jrnl/admin.py
index 5fcdc89..7d94b47 100644
--- a/app/jrnl/admin.py
+++ b/app/jrnl/admin.py
@@ -24,6 +24,7 @@ class EntryAdmin(OSMGeoAdmin):
search_fields = ['title', 'body_markdown']
prepopulated_fields = {"slug": ('title',)}
list_filter = ('pub_date', 'enable_comments', 'status', 'location__state__country__lux_region')
+ filter_horizontal = ('field_notes',)
fieldsets = (
('Entry', {
'fields': (
@@ -48,6 +49,7 @@ class EntryAdmin(OSMGeoAdmin):
('image', 'thumbnail'),
'template_name',
'enable_comments',
+ 'field_notes',
),
}),
)
diff --git a/app/jrnl/migrations/0017_entry_field_notes.py b/app/jrnl/migrations/0017_entry_field_notes.py
new file mode 100644
index 0000000..e013d5d
--- /dev/null
+++ b/app/jrnl/migrations/0017_entry_field_notes.py
@@ -0,0 +1,19 @@
+# Generated by Django 2.0.1 on 2018-02-08 07:43
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ('sketches', '0002_auto_20180208_0743'),
+ ('jrnl', '0016_auto_20161219_1058'),
+ ]
+
+ operations = [
+ migrations.AddField(
+ model_name='entry',
+ name='field_notes',
+ field=models.ManyToManyField(to='sketches.Sketch'),
+ ),
+ ]
diff --git a/app/jrnl/models.py b/app/jrnl/models.py
index b9018bf..17909df 100644
--- a/app/jrnl/models.py
+++ b/app/jrnl/models.py
@@ -20,6 +20,7 @@ from bs4 import BeautifulSoup
from photos.models import PhotoGallery, LuxImage
from locations.models import Location
+from sketches.models import Sketch
from utils.widgets import parse_image, parse_video
from utils.widgets import markdown_to_html
@@ -84,6 +85,7 @@ class Entry(models.Model):
template_name = models.IntegerField(choices=TEMPLATES, default=0)
featured_image = models.ForeignKey(LuxImage, on_delete=models.CASCADE, null=True, blank=True)
has_video = models.BooleanField(blank=True, default=False)
+ field_notes = models.ManyToManyField(Sketch)
class Meta:
ordering = ('-pub_date',)