summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorluxagraf <sng@luxagraf.net>2014-11-02 18:11:06 +0000
committerluxagraf <sng@luxagraf.net>2014-11-02 18:11:06 +0000
commitd283e039666fa57ccf06c3d235162927db285fb8 (patch)
tree15bd20b5c56751eec9c30032d1038c26c5c1d511 /app
parent0d0ed808b1f6e7899500078116f344d657fdc7e6 (diff)
added a nicer manytomany widget to homepage admin
Diffstat (limited to 'app')
-rw-r--r--app/blog/admin.py1
-rw-r--r--app/builder/base.py7
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)