entry photos in admin 0.8.1
authorJan Szejko <janek37@gmail.com>
Wed, 11 Jul 2018 15:28:54 +0000 (17:28 +0200)
committerJan Szejko <janek37@gmail.com>
Wed, 11 Jul 2018 15:28:54 +0000 (17:28 +0200)
migdal/admin.py
setup.py

index cf1c514..ed829e6 100644 (file)
@@ -5,7 +5,7 @@
 from django.conf import settings
 from django.contrib import admin
 from django.utils.translation import ugettext_lazy as _
 from django.conf import settings
 from django.contrib import admin
 from django.utils.translation import ugettext_lazy as _
-from migdal.models import Entry, Attachment
+from migdal.models import Entry, Attachment, Photo
 from migdal import app_settings
 from fnpdjango.utils.models import filtered_model
 from fnpdjango.utils.models.translation import translated_fields
 from migdal import app_settings
 from fnpdjango.utils.models import filtered_model
 from fnpdjango.utils.models.translation import translated_fields
@@ -16,6 +16,11 @@ class AttachmentInline(admin.TabularInline):
     readonly_fields = ['url']
 
 
     readonly_fields = ['url']
 
 
+class PhotoInline(admin.TabularInline):
+    model = Photo
+    readonly_fields = ['url']
+
+
 def filtered_entry_admin(typ):
     class EntryAdmin(admin.ModelAdmin):
         def get_queryset(self, request):
 def filtered_entry_admin(typ):
     class EntryAdmin(admin.ModelAdmin):
         def get_queryset(self, request):
@@ -46,7 +51,7 @@ def filtered_entry_admin(typ):
             (None, {
                 'fields': _promo_if_necessary + (
                     'in_stream', 'author', 'author_email', 'canonical_url', 'image',
             (None, {
                 'fields': _promo_if_necessary + (
                     'in_stream', 'author', 'author_email', 'canonical_url', 'image',
-                    'date', 'first_published_at', 'changed_at', 'gallery')
+                    'date', 'first_published_at', 'changed_at')
                 }),
         ) + tuple(
             (ln, {'fields': (
                 }),
         ) + tuple(
             (ln, {'fields': (
@@ -92,7 +97,7 @@ def filtered_entry_admin(typ):
         list_filter = _promo_if_necessary + \
             translated_fields(('published',)) + \
             translated_fields(('needed',), app_settings.OPTIONAL_LANGUAGES)
         list_filter = _promo_if_necessary + \
             translated_fields(('published',)) + \
             translated_fields(('needed',), app_settings.OPTIONAL_LANGUAGES)
-        inlines = (AttachmentInline,)
+        inlines = (PhotoInline, AttachmentInline)
         search_fields = ('title_pl', 'title_en')
     return EntryAdmin
 
         search_fields = ('title_pl', 'title_en')
     return EntryAdmin
 
index aaf0088..0349144 100755 (executable)
--- a/setup.py
+++ b/setup.py
@@ -23,7 +23,7 @@ def whole_trees(package_dir, paths):
 
 setup(
     name='django-migdal',
 
 setup(
     name='django-migdal',
-    version='0.8.0',
+    version='0.8.1',
     author='Radek Czajka',
     author_email='radoslaw.czajka@nowoczesnapolska.org.pl',
     maintainer='Jan Szejko',
     author='Radek Czajka',
     author_email='radoslaw.czajka@nowoczesnapolska.org.pl',
     maintainer='Jan Szejko',