summaryrefslogtreecommitdiff
path: root/cron
diff options
context:
space:
mode:
authorluxagraf@c63593aa-01b0-44d9-8516-4b9c7e931d7f <luxagraf@c63593aa-01b0-44d9-8516-4b9c7e931d7f>2009-11-12 21:58:26 +0000
committerluxagraf@c63593aa-01b0-44d9-8516-4b9c7e931d7f <luxagraf@c63593aa-01b0-44d9-8516-4b9c7e931d7f>2009-11-12 21:58:26 +0000
commitb0464d2bcb252c8d2cef9dfca9dd7b40ec498c55 (patch)
treef39715fefd2828fd794a25fcf5301ed1ffd14ce0 /cron
parentc9022d38a303dcd756d34a2cbc4e3c49b22e0cf2 (diff)
speed optimizations
Diffstat (limited to 'cron')
-rw-r--r--cron/create_country_sidebar.py19
-rw-r--r--cron/create_region_sidebar.py18
2 files changed, 37 insertions, 0 deletions
diff --git a/cron/create_country_sidebar.py b/cron/create_country_sidebar.py
new file mode 100644
index 0000000..f660c73
--- /dev/null
+++ b/cron/create_country_sidebar.py
@@ -0,0 +1,19 @@
+import sys, os
+
+sys.path.append('/home/luxagraf/webapps/django1_1')
+sys.path.append('/home/luxagraf/webapps/django1_1/luxagraf')
+sys.path.append('/home/luxagraf/webapps/django1_1/luxagraf/apps')
+sys.path.append('/home/luxagraf/webapps/django1_1/luxagraf/lib')
+sys.path.append('/home/luxagraf/webapps/django1_1/lib/python2.5/')
+os.environ['DJANGO_SETTINGS_MODULE'] = 'settings'
+
+from django.template import Context
+from django.template import loader
+from django.conf import settings
+from locations.models import Country,Region
+c = Context({'country_list': Country.objects.filter(visited=True),})
+t = loader.render_to_string('includes/country_sidebar_template.html',c)
+fpath = '%s%s' %(settings.PROJ_ROOT,'templates/includes/country_sidebar.html')
+file = open(fpath, 'w')
+file.write(t)
+file.close() \ No newline at end of file
diff --git a/cron/create_region_sidebar.py b/cron/create_region_sidebar.py
new file mode 100644
index 0000000..77f2628
--- /dev/null
+++ b/cron/create_region_sidebar.py
@@ -0,0 +1,18 @@
+import sys, os
+
+sys.path.append('/home/luxagraf/webapps/django1_1')
+sys.path.append('/home/luxagraf/webapps/django1_1/luxagraf')
+sys.path.append('/home/luxagraf/webapps/django1_1/luxagraf/apps')
+sys.path.append('/home/luxagraf/webapps/django1_1/luxagraf/lib')
+sys.path.append('/home/luxagraf/webapps/django1_1/lib/python2.5/')
+os.environ['DJANGO_SETTINGS_MODULE'] = 'settings'
+
+from django.template import Context,loader
+from django.conf import settings
+from locations.models import Region
+c = Context({'region_list': Region.objects.all(),})
+t = loader.render_to_string('includes/regions_sidebar_template.html',c)
+fpath = '%s%s' %(settings.PROJ_ROOT,'templates/includes/regions_sidebar.html')
+file = open(fpath, 'w')
+file.write(t)
+file.close() \ No newline at end of file