summaryrefslogtreecommitdiff
path: root/apps/blog
diff options
context:
space:
mode:
authorluxagraf <sng@luxagraf.net>2011-04-05 10:38:52 -0400
committerluxagraf <sng@luxagraf.net>2011-04-05 10:38:52 -0400
commit8e2e31965126bee7992d26428d42c1631d29786f (patch)
tree2ed3fc9b9898e9c381fe5c03cd04996b62d06c11 /apps/blog
parent79101240da1e0331c00e7b616a7a32b55d81e5cc (diff)
fixed image sprties, updated photo gallery codeand changed contact/about pages
Diffstat (limited to 'apps/blog')
-rw-r--r--apps/blog/signals.py38
1 files changed, 11 insertions, 27 deletions
diff --git a/apps/blog/signals.py b/apps/blog/signals.py
index 798a78f..55f2efa 100644
--- a/apps/blog/signals.py
+++ b/apps/blog/signals.py
@@ -6,32 +6,16 @@ from django.conf import settings
from locations.models import Region,Country,Route
+from build.base import BuildWriting
+
def update_recent(sender, instance, signal, *args, **kwargs):
if not settings.DEVELOPMENT:
- # Update recent entries static file
- model = get_model('blog', 'entry')
- qs = {'object_list': model.objects.filter(status__exact=1).order_by('-pub_date')[1:4]}
- c = Context(qs)
- t = render_to_string('bin/recent_entries.html',c)
- fpath = '%s%s' %(settings.PROJ_ROOT,'templates/includes/recent_entries.html')
- file = open(fpath, 'w')
- file.write(t)
- file.close()
- # Update map template
- import codecs
- qs = model.objects.filter(status__exact=1)
- cl = Country.objects.filter(visited=True).exclude(name='default')
- rl = Region.objects.all()
- rtl = Route.objects.all()
- c = Context({'object_list':qs, 'country_list':cl,'region_list':rl, 'route_list':rtl})
- t = render_to_string('bin/map_entry_list.html',c)
- fpath = '%s%s' %(settings.PROJ_ROOT,'media/js/mainmap.js')
- file = codecs.open(fpath, 'w','utf8')
- file.write(t)
- file.close()
- c = Context({'country_list':cl,'region_list':rl,'route_list':rtl})
- t = render_to_string('bin/map_sidebar.html',c)
- fpath = '%s%s' %(settings.PROJ_ROOT,'templates/includes/map_sidebar.html')
- file = codecs.open(fpath, 'w','utf8')
- file.write(t)
- file.close() \ No newline at end of file
+ if instance.status == 1:
+ #update homepage, archives and details
+ b = BuildWriting()
+ b.build_homepage()
+ b.build_archive_pages()
+ b.build_detail_pages()
+ #update map
+ b = BuildMap()
+ b.build() \ No newline at end of file