summaryrefslogtreecommitdiff
path: root/app/jrnl/admin.py
diff options
context:
space:
mode:
Diffstat (limited to 'app/jrnl/admin.py')
-rw-r--r--app/jrnl/admin.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/app/jrnl/admin.py b/app/jrnl/admin.py
index c3b0c81..2d843b9 100644
--- a/app/jrnl/admin.py
+++ b/app/jrnl/admin.py
@@ -6,6 +6,7 @@ from utils.widgets import AdminImageWidget, LGEntryForm
from .models import Entry, HomepageCurrator
from photos.forms import GalleryForm
+from photos.models import LuxImage
from utils.util import get_latlon
@@ -13,6 +14,10 @@ from utils.util import get_latlon
class EntryAdmin(OSMGeoAdmin):
form = LGEntryForm
+ def render_change_form(self, request, context, *args, **kwargs):
+ context['adminform'].form.fields['featured_image'].queryset = LuxImage.objects.all()[:50]
+ return super(EntryAdmin, self).render_change_form(request, context, *args, **kwargs)
+
def formfield_for_dbfield(self, db_field, **kwargs):
if db_field.name == 'thumbnail' or db_field.name == 'image':
field = forms.FileField(widget=AdminImageWidget)
@@ -46,7 +51,7 @@ class EntryAdmin(OSMGeoAdmin):
'fields': (
'dek',
'meta_description',
- ('image', 'thumbnail'),
+ 'image',
'template_name',
'enable_comments',
),
@@ -55,6 +60,7 @@ class EntryAdmin(OSMGeoAdmin):
'fields': (
'field_notes',
'books',
+ 'featured_image',
),
'classes': (
'collapse',
@@ -77,6 +83,9 @@ class EntryAdmin(OSMGeoAdmin):
class Media:
js = ('image-loader.js', 'next-prev-links.js')
+ css = {
+ "all": ("my_styles.css",)
+ }
@admin.register(HomepageCurrator)