diff options
-rw-r--r-- | app/jrnl/admin.py | 14 | ||||
-rw-r--r-- | app/jrnl/migrations/0018_auto_20180303_1037.py | 24 | ||||
-rw-r--r-- | app/jrnl/models.py | 2 | ||||
-rw-r--r-- | config/base_urls.py | 2 |
4 files changed, 38 insertions, 4 deletions
diff --git a/app/jrnl/admin.py b/app/jrnl/admin.py index 7d94b47..580d06f 100644 --- a/app/jrnl/admin.py +++ b/app/jrnl/admin.py @@ -24,13 +24,13 @@ 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',) + filter_horizontal = ('field_notes','books') fieldsets = ( ('Entry', { 'fields': ( 'title', 'body_markdown', - 'body_html', + #'body_html', ('pub_date', 'status'), 'slug', 'point' @@ -49,8 +49,18 @@ class EntryAdmin(OSMGeoAdmin): ('image', 'thumbnail'), 'template_name', 'enable_comments', + ), + }), + ('Extra', { + 'fields': ( 'field_notes', + 'books', ), + 'classes': ( + 'collapse', + 'extrapretty', + 'wide' + ) }), ) # options for OSM map Using custom ESRI topo map diff --git a/app/jrnl/migrations/0018_auto_20180303_1037.py b/app/jrnl/migrations/0018_auto_20180303_1037.py new file mode 100644 index 0000000..2b4baa6 --- /dev/null +++ b/app/jrnl/migrations/0018_auto_20180303_1037.py @@ -0,0 +1,24 @@ +# Generated by Django 2.0.1 on 2018-03-03 10:37 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('books', '0005_auto_20171214_2239'), + ('jrnl', '0017_entry_field_notes'), + ] + + operations = [ + migrations.AddField( + model_name='entry', + name='books', + field=models.ManyToManyField(blank=True, to='books.Book'), + ), + migrations.AlterField( + model_name='entry', + name='field_notes', + field=models.ManyToManyField(blank=True, to='sketches.Sketch'), + ), + ] diff --git a/app/jrnl/models.py b/app/jrnl/models.py index 9045321..c61876a 100644 --- a/app/jrnl/models.py +++ b/app/jrnl/models.py @@ -21,6 +21,7 @@ from bs4 import BeautifulSoup from photos.models import PhotoGallery, LuxImage from locations.models import Location from sketches.models import Sketch +from books.models import Book from utils.widgets import parse_image, parse_video from utils.widgets import markdown_to_html @@ -86,6 +87,7 @@ class Entry(models.Model): 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, blank=True) + books = models.ManyToManyField(Book, blank=True) class Meta: ordering = ('-pub_date',) diff --git a/config/base_urls.py b/config/base_urls.py index c48d75e..c0a2bfa 100644 --- a/config/base_urls.py +++ b/config/base_urls.py @@ -45,8 +45,6 @@ urlpatterns = [ path(r'expenses/', include('expenses.urls', namespace='expenses')), path(r'photos/', include('photos.urls')), path(r'books/', include('books.urls')), - #path(r'field-notes/', include('notes.urls')), - #path(r'birds/', include('birds.urls', namespace='birds')), path(r'sightings/', include('sightings.urls', namespace='sightings')), path(r'field-notes/', include('sketches.urls', namespace='sketches')), path(r'src/', include('src.urls', namespace='src')), |