diff options
-rw-r--r-- | app/blog/admin.py | 1 | ||||
-rw-r--r-- | app/builder/base.py | 7 |
2 files changed, 5 insertions, 3 deletions
diff --git a/app/blog/admin.py b/app/blog/admin.py index de6a838..3038a4f 100644 --- a/app/blog/admin.py +++ b/app/blog/admin.py @@ -78,6 +78,7 @@ class PostImageAdmin(admin.ModelAdmin): list_display = ('title', 'post_image') class HomepageCurratorAdmin(admin.ModelAdmin): + filter_horizontal = ('entry_list',) pass diff --git a/app/builder/base.py b/app/builder/base.py index c27c599..7382655 100644 --- a/app/builder/base.py +++ b/app/builder/base.py @@ -139,9 +139,10 @@ class BuildWriting(Build): self.write_file(fpath, t) def build_homepage(self): - qs = get_model('blog', 'entry').objects.filter(status__exact=1,home_page_banner=1)[:4] - c = Context({'object_list': qs, 'MEDIA_URL': settings.BAKED_MEDIA_URL, 'IMAGES_URL': settings.BAKED_IMAGES_URL}) - t = render_to_string('archives/homepage.html', c).encode('utf-8') + obj = get_model('blog', 'homepagecurrator').objects.get(pk=1) + template = obj.template_name + c = Context({'homepage': obj, 'MEDIA_URL': settings.BAKED_MEDIA_URL, 'IMAGES_URL': settings.BAKED_IMAGES_URL}) + t = render_to_string(template, c).encode('utf-8') self.write_file('', t) |