Skip to content

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
  • 8 commits
  • 117 files changed
  • 0 commit comments
  • 1 contributor
Showing with 311 additions and 72 deletions.
  1. +97 −27 dsp/dst/models.py
  2. +4 −1 dsp/dst/urls.py
  3. +136 −6 dsp/dst/views.py
  4. +5 −2 dsp/manage.py
  5. +12 −5 dsp/mediaroot/css/src/buttons.css
  6. +4 −2 dsp/mediaroot/css/src/grid.css
  7. +40 −19 dsp/mediaroot/css/src/tech.css
  8. +13 −10 dsp/mediaroot/css/src/typography.css
  9. BIN dsp/mediaroot/img/extra/arrow.gif
  10. BIN dsp/mediaroot/img/extra/minus.gif
  11. BIN dsp/mediaroot/img/extra/please_select.gif
  12. BIN dsp/mediaroot/small/technologies/Icon_activated_sludge.png
  13. BIN dsp/mediaroot/small/technologies/Icon_aerated_pond.png
  14. BIN dsp/mediaroot/small/technologies/Icon_anaerobic_baffled_reactor.png
  15. BIN dsp/mediaroot/small/technologies/Icon_anaerobic_baffled_reactor_2.png
  16. BIN dsp/mediaroot/small/technologies/Icon_anaerobic_biogas_reactor.png
  17. BIN dsp/mediaroot/small/technologies/Icon_anaerobic_filter.png
  18. BIN dsp/mediaroot/small/technologies/Icon_application_of_compost_eco_humus.png
  19. BIN dsp/mediaroot/small/technologies/Icon_application_of_dehydrated_faeces.png
  20. BIN dsp/mediaroot/small/technologies/Icon_application_of_urine.png
  21. BIN dsp/mediaroot/small/technologies/Icon_aquaculture_ponds.png
  22. BIN dsp/mediaroot/small/technologies/Icon_cistern_flush_toilet.png
  23. BIN dsp/mediaroot/small/technologies/Icon_co-composting.png
  24. BIN dsp/mediaroot/small/technologies/Icon_composting_chamber.png
  25. BIN dsp/mediaroot/small/technologies/Icon_conventional_gravity_sewer.png
  26. BIN dsp/mediaroot/small/technologies/Icon_dehydration_vault.png
  27. BIN dsp/mediaroot/small/technologies/Icon_dehydration_vaults_2.png
  28. BIN dsp/mediaroot/small/technologies/Icon_double_ventilated_improved_pit.png
  29. BIN dsp/mediaroot/small/technologies/Icon_dry_toilet.png
  30. BIN dsp/mediaroot/small/technologies/Icon_fill_and_cover_arborloo.png
  31. BIN dsp/mediaroot/small/technologies/Icon_floating_plant_macrophyte_pond.png
  32. BIN dsp/mediaroot/small/technologies/Icon_fossa_alterna.png
  33. BIN dsp/mediaroot/small/technologies/Icon_free-water_surface_constructed_wetland.png
  34. BIN dsp/mediaroot/small/technologies/Icon_horizontal_subsurface_flow_constructed_wetland.png
  35. BIN dsp/mediaroot/small/technologies/Icon_human_powered_emptying_and_transport.png
  36. BIN dsp/mediaroot/small/technologies/Icon_irrigation.png
  37. BIN dsp/mediaroot/small/technologies/Icon_jerrycan_tank.png
  38. BIN dsp/mediaroot/small/technologies/Icon_land_application_of_sludge.png
  39. BIN dsp/mediaroot/small/technologies/Icon_leach_field.png
  40. BIN dsp/mediaroot/small/technologies/Icon_motorized_emptying_and_transport.png
  41. BIN dsp/mediaroot/small/technologies/Icon_planted_drying_beds.png
  42. BIN dsp/mediaroot/small/technologies/Icon_pour_flush_toilet.png
  43. BIN dsp/mediaroot/small/technologies/Icon_sedimentation_thickening_ponds.png
  44. BIN dsp/mediaroot/small/technologies/Icon_septic_tank.png
  45. BIN dsp/mediaroot/small/technologies/Icon_septic_tank_2.png
  46. BIN dsp/mediaroot/small/technologies/Icon_sewer_discharge_station.png
  47. BIN dsp/mediaroot/small/technologies/Icon_simplified_sewers.png
  48. BIN dsp/mediaroot/small/technologies/Icon_single_pit.png
  49. BIN dsp/mediaroot/small/technologies/Icon_single_ventilated_improved_pit.png
  50. BIN dsp/mediaroot/small/technologies/Icon_soak_pit.png
  51. BIN dsp/mediaroot/small/technologies/Icon_solids_free_sewer.png
  52. BIN dsp/mediaroot/small/technologies/Icon_surface_disposal.png
  53. BIN dsp/mediaroot/small/technologies/Icon_transfer_station_underground_holding_tank.png
  54. BIN dsp/mediaroot/small/technologies/Icon_trickling_filter.png
  55. BIN dsp/mediaroot/small/technologies/Icon_twin_pits_for_pour_flush.png
  56. BIN dsp/mediaroot/small/technologies/Icon_unplanted_drying_beds.png
  57. BIN dsp/mediaroot/small/technologies/Icon_upflow_anaerobic_sludge_blanket_reactor.png
  58. BIN dsp/mediaroot/small/technologies/Icon_urinal.png
  59. BIN dsp/mediaroot/small/technologies/Icon_urine_diverting_dry_toilet.png
  60. BIN dsp/mediaroot/small/technologies/Icon_urine_diverting_flush_toilet.png
  61. BIN dsp/mediaroot/small/technologies/Icon_urine_storage_tank_container.png
  62. BIN dsp/mediaroot/small/technologies/Icon_vertical_flow_constructed_wetland.png
  63. BIN dsp/mediaroot/small/technologies/Icon_waste_stabilization_ponds.png
  64. BIN dsp/mediaroot/small/technologies/Icon_water_disposal_groundwater_recharge.png
  65. BIN dsp/mediaroot/technologies/Icon_activated_sludge.png
  66. BIN dsp/mediaroot/technologies/Icon_aerated_pond.png
  67. BIN dsp/mediaroot/technologies/Icon_anaerobic_baffled_reactor.png
  68. BIN dsp/mediaroot/technologies/Icon_anaerobic_baffled_reactor_2.png
  69. BIN dsp/mediaroot/technologies/Icon_anaerobic_biogas_reactor.png
  70. BIN dsp/mediaroot/technologies/Icon_anaerobic_filter.png
  71. BIN dsp/mediaroot/technologies/Icon_application_of_compost_eco_humus.png
  72. BIN dsp/mediaroot/technologies/Icon_application_of_dehydrated_faeces.png
  73. BIN dsp/mediaroot/technologies/Icon_application_of_urine.png
  74. BIN dsp/mediaroot/technologies/Icon_aquaculture_ponds.png
  75. BIN dsp/mediaroot/technologies/Icon_cistern_flush_toilet.png
  76. BIN dsp/mediaroot/technologies/Icon_co-composting.png
  77. BIN dsp/mediaroot/technologies/Icon_composting_chamber.png
  78. BIN dsp/mediaroot/technologies/Icon_conventional_gravity_sewer.png
  79. BIN dsp/mediaroot/technologies/Icon_dehydration_vault.png
  80. BIN dsp/mediaroot/technologies/Icon_dehydration_vaults_2.png
  81. BIN dsp/mediaroot/technologies/Icon_double_ventilated_improved_pit.png
  82. BIN dsp/mediaroot/technologies/Icon_dry_toilet.png
  83. BIN dsp/mediaroot/technologies/Icon_fill_and_cover_arborloo.png
  84. BIN dsp/mediaroot/technologies/Icon_floating_plant_macrophyte_pond.png
  85. BIN dsp/mediaroot/technologies/Icon_fossa_alterna.png
  86. BIN dsp/mediaroot/technologies/Icon_free-water_surface_constructed_wetland.png
  87. BIN dsp/mediaroot/technologies/Icon_horizontal_subsurface_flow_constructed_wetland.png
  88. BIN dsp/mediaroot/technologies/Icon_human_powered_emptying_and_transport.png
  89. BIN dsp/mediaroot/technologies/Icon_irrigation.png
  90. BIN dsp/mediaroot/technologies/Icon_jerrycan_tank.png
  91. BIN dsp/mediaroot/technologies/Icon_land_application_of_sludge.png
  92. BIN dsp/mediaroot/technologies/Icon_leach_field.png
  93. BIN dsp/mediaroot/technologies/Icon_motorized_emptying_and_transport.png
  94. BIN dsp/mediaroot/technologies/Icon_planted_drying_beds.png
  95. BIN dsp/mediaroot/technologies/Icon_pour_flush_toilet.png
  96. BIN dsp/mediaroot/technologies/Icon_sedimentation_thickening_ponds.png
  97. BIN dsp/mediaroot/technologies/Icon_septic_tank.png
  98. BIN dsp/mediaroot/technologies/Icon_septic_tank_2.png
  99. BIN dsp/mediaroot/technologies/Icon_sewer_discharge_station.png
  100. BIN dsp/mediaroot/technologies/Icon_simplified_sewers.png
  101. BIN dsp/mediaroot/technologies/Icon_single_pit.png
  102. BIN dsp/mediaroot/technologies/Icon_single_ventilated_improved_pit.png
  103. BIN dsp/mediaroot/technologies/Icon_soak_pit.png
  104. BIN dsp/mediaroot/technologies/Icon_solids_free_sewer.png
  105. BIN dsp/mediaroot/technologies/Icon_surface_disposal.png
  106. BIN dsp/mediaroot/technologies/Icon_transfer_station_underground_holding_tank.png
  107. BIN dsp/mediaroot/technologies/Icon_trickling_filter.png
  108. BIN dsp/mediaroot/technologies/Icon_twin_pits_for_pour_flush.png
  109. BIN dsp/mediaroot/technologies/Icon_unplanted_drying_beds.png
  110. BIN dsp/mediaroot/technologies/Icon_upflow_anaerobic_sludge_blanket_reactor.png
  111. BIN dsp/mediaroot/technologies/Icon_urinal.png
  112. BIN dsp/mediaroot/technologies/Icon_urine_diverting_dry_toilet.png
  113. BIN dsp/mediaroot/technologies/Icon_urine_diverting_flush_toilet.png
  114. BIN dsp/mediaroot/technologies/Icon_urine_storage_tank_container.png
  115. BIN dsp/mediaroot/technologies/Icon_vertical_flow_constructed_wetland.png
  116. BIN dsp/mediaroot/technologies/Icon_waste_stabilization_ponds.png
  117. BIN dsp/mediaroot/technologies/Icon_water_disposal_groundwater_recharge.png
View
124 dsp/dst/models.py
@@ -9,9 +9,60 @@
from django.utils.translation import ugettext, ugettext_lazy as _
import itertools
-
+import logging
from utils import pretty_name
+# PROFILING
+import hotshot
+import os
+import time
+import settings
+
+try:
+ PROFILE_LOG_BASE = settings.PROFILE_LOG_BASE
+except:
+ PROFILE_LOG_BASE = "/tmp"
+
+
+def profile(log_file):
+ """Profile some callable.
+
+ This decorator uses the hotshot profiler to profile some callable (like
+ a view function or method) and dumps the profile data somewhere sensible
+ for later processing and examination.
+
+ It takes one argument, the profile log name. If it's a relative path, it
+ places it under the PROFILE_LOG_BASE. It also inserts a time stamp into the
+ file name, such that 'my_view.prof' become 'my_view-20100211T170321.prof',
+ where the time stamp is in UTC. This makes it easy to run and compare
+ multiple trials.
+ """
+
+ if not os.path.isabs(log_file):
+ log_file = os.path.join(PROFILE_LOG_BASE, log_file)
+
+ def _outer(f):
+ def _inner(*args, **kwargs):
+ # Add a timestamp to the profile output when the callable
+ # is actually called.
+ (base, ext) = os.path.splitext(log_file)
+ base = base + "-" + time.strftime("%Y%m%dT%H%M%S", time.gmtime())
+ final_log_file = base + ext
+
+ prof = hotshot.Profile(final_log_file)
+ try:
+ ret = prof.runcall(f, *args, **kwargs)
+ finally:
+ prof.close()
+ return ret
+
+ return _inner
+ return _outer
+
+# END PROFILING
+
+
+
class Factor(models.Model):
factor = models.CharField(_(u'factor'), max_length=50)
order = models.IntegerField(_(u'order'),)
@@ -93,8 +144,9 @@ class Technology(models.Model):
description = models.TextField(_(u'description'),)
#input = models.ManyToManyField('self', blank=True, related_name='output', symmetrical=False, )
output = models.ManyToManyField('self', blank=True, related_name='input', symmetrical=False, )
- image = models.ImageField(upload_to='technologies')
+ image = models.CharField(_(u'image'), max_length=100)
url = models.URLField(blank=True, verify_exists = False, help_text=_('Enter the url to the corresponding Akvopedia entry, beginning with http://.'))
+ linked_techs = models.ManyToManyField('self',blank=True, related_name='linked_tech',symmetrical=True)
def __unicode__(self):
@@ -117,6 +169,7 @@ def output(self):
"find all techs that have self as input"
return Technology.objects.filter(input__in=self)
+
def all_output(self):
"find all techs that have self as input recursively"
return (
@@ -137,21 +190,25 @@ def all_input(self):
self.input().input().input().input().input()
).distinct()
- def all_linked_techs(self):
- """
- find all techs linked to self
- the reason for itertools is that when I do
- (self.all_input() | self.all_output()) the result is not
- the expected union of all_input and all_output
- """
- return itertools.chain(self.all_input(), self.all_output())
+ #def all_linked_techs(self):
+ # """
+ # find all techs linked to self
+ # the reason for itertools is that when I do
+ # (self.all_input() | self.all_output()) the result is not
+ # the expected union of all_input and all_output
+ # """
+ # return itertools.chain(self.all_input(), self.all_output())
def all_chosen(self, session):
return self.filter(tech_choices__session=session).order_by('group__order')
- def all_linked_techs(self):
- return Technology.objects.filter(pk=self.pk).all_linked_techs()
+
+
+ #def all_linked_techs(self):
+ # #return Technology.objects.filter(pk=self.pk).all_linked_techs()
+
+
def display_output(self):
return "<table style=''>%s</table>" % "".join(
["<tr><td style='text-align: left; border: 0px;'>%s</td><td style='border: 0px;'>%s</td></tr>" % (
@@ -172,20 +229,27 @@ def display_image(self, style=''):
else:
return '<img src="%s%s" />' % (settings.MEDIA_URL, self.image)
display_image.allow_tags = True
-
- def availability(self, session):
- """
- figure out if I am "available" that is can be used given choices of techs already made
- """
- chosen_techs = Technology.objects.filter(tech_choices__session=session)
- if self in chosen_techs:
- return self.TECH_USE_CHOSEN
- if self.group in [t.group for t in chosen_techs]:
- return self.TECH_USE_NOT_ALLOWED
- if self in chosen_techs.all_linked_techs():
- return True
- return False
+
+ #def availability(self, session):
+ # """
+ # figure out if I am "available" that is can be used given choices of techs already made
+ # """
+ # chosen_techs = Technology.objects.filter(tech_choices__session=session)
+ # # self is within the chosen techs
+ # if self in chosen_techs:
+ # return self.TECH_USE_CHOSEN
+ #
+ # # self is in a group where a choice has already been made, and because we failed the first test, we are not the one chosen. Hence not available
+ # if self.group in [t.group for t in chosen_techs]:
+ # return self.TECH_USE_NOT_ALLOWED
+ #
+ # # self is within those techs which are linked to the chosen techs, hence available.
+ # if self in chosen_techs.all_linked_techs():
+ # return True
+ # return False
+ #
+
def applicable(self, session):
"""
figure out if I'm applicable given the current environmental factors
@@ -194,19 +258,23 @@ def applicable(self, session):
answers = Answer.objects.filter(session=session, applicable__exact=True)
# given the answers, get the corresponding criteria
criteria = Criterion.objects.filter(answer__in=answers)
+
# now try to find one or more instances of Relevancy.applicability = CHOICE_NO
if len(self.relevancies.filter(applicability=Relevancy.CHOICE_NO, criterion__in=criteria)):
return self.TECH_USE_NO
+
# if we found no CHOICE_NO relevanciew try for CHOICE_MAYBE
elif len(self.relevancies.filter(applicability=Relevancy.CHOICE_MAYBE, criterion__in=criteria)):
return self.TECH_USE_MAYBE
+
# if we found no CHOICE_MAYBE relevanciew try for CHOICE_YES
elif len(self.relevancies.filter(applicability=Relevancy.CHOICE_YES, criterion__in=criteria)):
return self.TECH_USE_YES
+
# this thech was not affected by the environmental factors
return self.TECH_USE_YES
-
+
def usability(self, session):
"""
figure out "usability" status based on Answers and TechChoices
@@ -228,7 +296,9 @@ def usability(self, session):
# return self.TECH_USE_NOT_ALLOWED
# find all techs linked to self
- my_linked = [t for t in self.all_linked_techs()]
+ my_linked = [t for t in self.linked_techs.all()]
+ #my_linked = [t for t in self.all_linked_techs()]
+
my_linked = set(my_linked)
chosen = set(chosen_techs)
# all techs already chosen must be linked to me;
View
5 dsp/dst/urls.py
@@ -1,7 +1,9 @@
-# -*- coding: utf-8 -*-
+ # -*- coding: utf-8 -*-
from django.conf.urls.defaults import *
from django.views.generic.simple import direct_to_template
+import logging
+from datetime import datetime
urlpatterns = patterns('',
url(r'^$', 'dst.views.index', name='index'),
@@ -10,6 +12,7 @@
url(r'^(?P<model>\w+)_factorhelp/(?P<id>\d+)/$', 'dst.views.factor_help', name='factor_help'),
url(r'^technologies/$', 'dst.views.technologies', name='technologies'),
+ url(r'^techs_selected/$', 'dst.views.techs_selected', name='techs_selected'),
url(r'^technologies/(?P<id>\d+)/help/$', 'dst.views.technologies_help', name='technologies_help'),
url(r'^choice/(?P<tech_id>\d+)/$', 'dst.views.tech_choice', name='tech_choice'),
View
142 dsp/dst/views.py
@@ -8,16 +8,66 @@
from django.http import HttpResponse, HttpResponseRedirect
from django.shortcuts import render_to_response, get_object_or_404
from django.template import RequestContext
-
+import logging
+from datetime import datetime
from models import Factor, TechGroup, Technology, Relevancy, Answer, Criterion, TechChoice
from utils import pretty_name
+# PROFILING
+import hotshot
+import os
+import time
+import settings
+
+try:
+ PROFILE_LOG_BASE = settings.PROFILE_LOG_BASE
+except:
+ PROFILE_LOG_BASE = "/tmp"
+
+
+def profile(log_file):
+ """Profile some callable.
+
+ This decorator uses the hotshot profiler to profile some callable (like
+ a view function or method) and dumps the profile data somewhere sensible
+ for later processing and examination.
+
+ It takes one argument, the profile log name. If it's a relative path, it
+ places it under the PROFILE_LOG_BASE. It also inserts a time stamp into the
+ file name, such that 'my_view.prof' become 'my_view-20100211T170321.prof',
+ where the time stamp is in UTC. This makes it easy to run and compare
+ multiple trials.
+ """
+
+ if not os.path.isabs(log_file):
+ log_file = os.path.join(PROFILE_LOG_BASE, log_file)
+
+ def _outer(f):
+ def _inner(*args, **kwargs):
+ # Add a timestamp to the profile output when the callable
+ # is actually called.
+ (base, ext) = os.path.splitext(log_file)
+ base = base + "-" + time.strftime("%Y%m%dT%H%M%S", time.gmtime())
+ final_log_file = base + ext
+
+ prof = hotshot.Profile(final_log_file)
+ try:
+ ret = prof.runcall(f, *args, **kwargs)
+ finally:
+ prof.close()
+ return ret
+
+ return _inner
+ return _outer
+
+# END PROFILING
class HttpResponseNoContent(HttpResponse):
status_code = 204
def get_session(request):
session, created = Session.objects.get_or_create(pk=request.session.session_key)
+ #session = Session.objects.get(pk=request.session.session_key)
return session
def render_to(template):
@@ -49,6 +99,7 @@ def wrapper(request, *args, **kw):
@render_to('dst/index.html')
def index(request):
+ request.session.set_test_cookie()
try:
return HttpResponseRedirect(settings.START_URL)
except:
@@ -82,9 +133,22 @@ class Meta:
def init(request):
request.session['init'] = init
HttpResponseRedirect(reverse('factors'))
+
+def initialize_linked_techs():
+ techs = Technology.objects.all()
+ for tech in techs:
+ linked_all=tech.all_linked_techs()
+ for linked in linked_all:
+ tech.linked_techs.add(linked)
+
+ for tech in techs:
+ linked_all=tech.linked_techs.all()
+ for linked in linked_all:
+ #logging.debug('tech %s links to %s' % (tech, linked))
def init_session(session):
uses = 'TECH_USE_NO', 'TECH_USE_MAYBE', 'TECH_USE_YES', 'TECH_USE_NOT_ALLOWED'
+ # initialize_linked_techs()
btns = [getattr(Technology, use) for use in uses]
buttons = ["%s_ishidden" % btn for btn in btns ]
for button in buttons:
@@ -142,16 +206,81 @@ def factor_help(request, model=None, id=None):
help_item = None
return {'help_item': help_item}
-
+#@profile("technologies.prof")
@render_to('dst/technologies.html')
-def technologies(request):
+def technologies(request, model=None, id=None):
+ if request.session.test_cookie_worked():
+ request.session.delete_test_cookie()
+
+ #forms part
+ init_session(request.session)
+ AnswerFormSet = modelformset_factory(
+ Answer,
+ form = AnswerForm,
+ extra = 0,
+ )
+
+ if request.method == 'POST':
+ formset = AnswerFormSet(request.POST, request.FILES)
+ if formset.is_valid():
+ formset.save()
+
+ #if there are no valid answers, we just default to false
+ qs = get_or_create_answers(get_session(request))
+
+ formset = AnswerFormSet(queryset=qs)
+ form_list = [form for form in formset.forms]
+ change_list = []
+ factor_list = []
+ old_factor = ''
+
+ for form in formset.forms:
+ new_factor = form.instance.criterion.factor
+ factor_list.append(new_factor)
+ change_list.append(new_factor != old_factor)
+ form.fields['applicable'].label = pretty_name(str(form.instance.criterion))
+ old_factor = new_factor
+
+ zipped_formlist = zip(form_list, factor_list, change_list)
+
+ if model:
+ help_item = get_model('dst', model).objects.get(id=id)
+ else:
+ help_item = None
+ #end forms part
+
+ #technology part
+ groups = TechGroup.objects.all()
+ group_techs = []
+ for group in groups:
+ techs = Technology.objects.filter(group=group)
+ for tech in techs:
+ tech.usable = tech.usability(get_session(request))
+ # tech.available = tech.availability(get_session(request))
+ group_techs.append(techs)
+ # if we want to transpose the data:
+ #all_techs = map(None, *group_techs)
+ all_techs = zip(groups, group_techs)
+
+ return {
+ 'techgroups' : groups,
+ 'all_techs' : all_techs,
+ 'session' : request.session,
+ 'formset' : formset,
+ 'zipped_formlist' : zipped_formlist,
+ 'help_item' : help_item,
+ }
+
+@render_to('dst/techs_selected.html')
+def techs_selected(request, model=None, id=None):
+
groups = TechGroup.objects.all()
group_techs = []
for group in groups:
techs = Technology.objects.filter(group=group)
for tech in techs:
tech.usable = tech.usability(get_session(request))
- tech.available = tech.availability(get_session(request))
+ # tech.available = tech.availability(get_session(request))
group_techs.append(techs)
# if we want to transpose the data:
#all_techs = map(None, *group_techs)
@@ -164,6 +293,7 @@ def technologies(request):
}
+
def tech_choice(request, tech_id):
choice, created = TechChoice.objects.get_or_create(session=get_session(request), technology=Technology.objects.get(pk=tech_id))
if not created:
@@ -181,7 +311,7 @@ def toggle_button(request, btn_name=''):
def reset_all(request):
request.session.flush()
- return HttpResponseRedirect(reverse('factors'))
+ return HttpResponseRedirect(reverse('technologies'))
def reset_techs(request):
@@ -218,7 +348,7 @@ def solution(request):
chosen_techs = Technology.objects.filter(group=group).filter(tech_choices__session=get_session(request))
for tech in chosen_techs:
tech.usable = tech.usability(get_session(request))
- tech.available = tech.availability(get_session(request))
+ # tech.available = tech.availability(get_session(request))
group_techs.append(chosen_techs)
# if we want to transpose the data:
View
7 dsp/manage.py
@@ -1,11 +1,14 @@
#!/usr/bin/env python
from django.core.management import execute_manager
+import imp
try:
- import settings # Assumed to be in the same directory.
+ imp.find_module('settings') # Assumed to be in the same directory.
except ImportError:
import sys
- sys.stderr.write("Error: Can't find the file 'settings.py' in the directory containing %r. It appears you've customized things.\nYou'll have to run django-admin.py, passing it your settings module.\n(If the file settings.py does indeed exist, it's causing an ImportError somehow.)\n" % __file__)
+ sys.stderr.write("Error: Can't find the file 'settings.py' in the directory containing %r. It appears you've customized things.\nYou'll have to run django-admin.py, passing it your settings module.\n" % __file__)
sys.exit(1)
+import settings
+
if __name__ == "__main__":
execute_manager(settings)
View
17 dsp/mediaroot/css/src/buttons.css
@@ -5,14 +5,15 @@ http://www.zurb.com/article/266/super-awesome-buttons-with-css3-and-rgba
.awesome, .awesome:visited {
background: #222 url(../../img/base/awesome/alert-overlay.png) repeat-x;
display: inline-block;
- padding: 5px 10px 6px;
- color: #fff;
+ padding: 3px 5px 3px 5px;
+ color: #0b50ae;
text-decoration: none;
- -moz-border-radius: 5px;
+
+ -moz-border-radius: 5px;
-webkit-border-radius: 5px;
-moz-box-shadow: 0 1px 3px rgba(0,0,0,0.5);
-webkit-box-shadow: 0 1px 3px rgba(0,0,0,0.5);
- text-shadow: 0 -1px 1px rgba(0,0,0,0.25);
+
border-bottom: 1px solid rgba(0,0,0,0.25);
position: relative;
cursor: pointer;
@@ -23,7 +24,7 @@ http://www.zurb.com/article/266/super-awesome-buttons-with-css3-and-rgba
.small.awesome, .small.awesome:visited { font-size: 11px; padding: ; }
.awesome, .awesome:visited, .medium.awesome, .medium.awesome:visited {
- font-size: 13px; font-weight: bold; line-height: 1; text-shadow: 0 -1px 1px rgba(0,0,0,0.25);
+ font-size: 13px; font-weight: normal; line-height: 1;
}
/*
.small.awesome, .small.awesome:visited { font-size: 0.8125em; padding: ; }
@@ -36,6 +37,10 @@ http://www.zurb.com/article/266/super-awesome-buttons-with-css3-and-rgba
.green.awesome:hover { background-color: #749a02; }
.blue.awesome, .blue.awesome:visited { background-color: #2daebf; }
.blue.awesome:hover { background-color: #007d9a; }
+
+.blue_w.awesome, .blue_w.awesome:visited { color:#fff; background-color: #2daebf; text-shadow: none; }
+.blue_w.awesome:hover { background-color: #007d9a; }
+
.red.awesome, .red.awesome:visited { background-color: #e33100; }
.red.awesome:hover { background-color: #872300; }
.magenta.awesome, .magenta.awesome:visited { background-color: #a9014b; }
@@ -48,6 +53,8 @@ http://www.zurb.com/article/266/super-awesome-buttons-with-css3-and-rgba
.aqua.awesome:hover { background-color: #2D9CC4; }
.grey.awesome, .grey.awesome:visited { background-color: #888; }
.grey.awesome:hover { background-color: #999; }
+.white.awesome, .aqua.awesome:visited { background-color: #e8f2ff; }
+.white.awesome:hover { background-color: #cfe3fd; }
.ok.awesome, .ok.awesome:visited { color:#111; background-color: #B2FFA1; text-shadow: none; }
.ok.awesome:hover { background-color: #34FC53; }
View
6 dsp/mediaroot/css/src/grid.css
@@ -56,14 +56,17 @@ body {
-------------------------------------------------------------- */
/* Sets up basic grid floating and margin. */
-div.span-1, div.span-2, div.span-3, div.span-4, div.span-5, div.span-6, div.span-7, div.span-8, div.span-9, div.span-10, div.span-11, div.span-12, div.span-13, div.span-14, div.span-15, div.span-16, div.span-17, div.span-18 {float:left;margin-right: 15px;}
+div.span-1, div.span-2, div.span-2a, div.span-3, div.span-4, div.span-5, div.span-6, div.span-7, div.span-8, div.span-9, div.span-10, div.span-11, div.span-12, div.span-13, div.span-14, div.span-15, div.span-16, div.span-17, div.span-18 {float:left;margin-right: 15px;}
/* The last column in a row needs this class. */
div.last { margin-right: 0; }
/* Use these classes to set the width of a column. */
+.span-1a { width: 20px; margin-right:0px;}
.span-1 { width: 40px;}
.span-2 { width: 95px;}
+.span-2a { width: 110px;}
+.span-2b { width: 90px; float:left; margin-right:5px;}
.span-3 { width: 150px;}
.span-4 { width: 205px;}
.span-5 { width: 260px;}
@@ -161,7 +164,6 @@ div.colborder {
.pull-1, .pull-2, .pull-3, .pull-4, .pull-5, .pull-6, .pull-7, .pull-8, .pull-9, .pull-10, .pull-11, .pull-12, .pull-13, .pull-14, .pull-15, .pull-16, .pull-17, .pull-18 {float:left;position:relative;}
-
.push-1 { margin: 0 -55px 1.5em 55px;}
.push-2 { margin: 0 -110px 1.5em 110px;}
.push-3 { margin: 0 -165px 1.5em 165px;}
View
59 dsp/mediaroot/css/src/tech.css
@@ -1,50 +1,71 @@
.tech {
- height:200px;
- margin-left:auto;
- margin-right:auto;
+ height:165px;
+ margin-left:5px;
+ margin-right:5px;
+ padding:4px 4px 4px 4px;
+ background:#fff;
+ border:1px solid #0b50ae;
width:100px;
/*border-bottom:1px solid #ccc; */
+ margin-bottom:25px;
+}
+
+.techs_selected {
+ height:155px;
+ margin-left:25px;
+ margin-right:25px;
+ padding:4px 4px 4px 4px;
+ background:#fff;
+ border:1px solid #0b50ae;
+ width:110px;
+ /*border-bottom:1px solid #ccc; */
+ margin-bottom:25px;
+}
+.tech_top {
+ height:90px;
+ margin-left:10px;
+ margin-right:10px;
+ padding:4px 4px 4px 4px;
+ background:#fff;
+ border:1px solid #0b50ae;
+ width:80px;
+ /*border-bottom:1px solid #ccc; */
margin-bottom:30px;
}
.back_yes_img /*, #toggle_yes*/ {
- background-color:#DCEDD0;
- background-color:#B2FFA1;
+ background-color:#c7fdbe;
}
.back_maybe_img /*, #toggle_maybe*/ {
- background-color:#FBF9CF;
- background-color:#FEF49C;
+ background-color:#dab159;
}
.back_no_img /*, #toggle_no*/ {
- background-color:#F6C8AB;
- background-color:#FFC7C7;
+ background-color:#ed6262;
}
-
+/* not used
.back_na_img, #toggle_na {
background-color:#C9C299;
background-color:#CCFFCC;
background-color:#EEEEEE;
-}
+} */
.back_hide, #toggle_hide {
/*display: none;*/
}
.back_hide_img {
- filter:alpha(opacity=20);
- -moz-opacity:0.2;
- -khtml-opacity: 0.2;
- opacity: 0.2;
+ filter:alpha(opacity=15);
+ -moz-opacity:0.15;
+ -khtml-opacity: 0.15;
+ opacity: 0.;
}
.back_chosen_img, #toggle_chosen {
- background-color:#FF4400;
- background-color:#86A8E3;
- background-color:#EAF2F5;
- background-color:#ADF4FF;
+ background-color:#c7fdbe;
+ border:4px solid #0b50ae;
}
#toggles > a {
View
23 dsp/mediaroot/css/src/typography.css
@@ -36,6 +36,7 @@ a { color:#2B80AF; text-decoration: none; cursor: pointer; }
a:visited { color:#2B80AF; }
a:hover { color:#0FA0CB; text-decoration: underline; }
+
p {
font-size:0.875em; /* 16*0.875 = 14*/
line-height:1.4em;
@@ -72,10 +73,10 @@ h4 {
}
h5 {
- color:#000;
- font-size: 0.8125em;
+ color:#000;
+ font-size:0.8em;
line-height:1.2em;
- margin-bottom:0.5em;
+ margin-bottom:0.3em;
}
@@ -93,10 +94,10 @@ h6 {
ul, ol {
margin-bottom:0.5em;
- line-height:1.7em;
- font-size:0.875em;
+ line-height:1.0em;
+ font-size:0.775em;
color:#333;
- margin-top:-0.5em;
+ margin-top:0.5em;
margin-bottom:1.5em;
}
@@ -190,10 +191,7 @@ input[type="submit"], input[type="button"] {
}
input[type='checkbox'], input[type='radio'] {
- margin-right:1em;
- margin-bottom:1em;
- margin: 0.5em 1px;
- margin-left:1em;
+ margin:0.25em 0.25em 0.25em 0.25em;
}
textarea { border: 1px solid #ccc;}
@@ -237,6 +235,11 @@ p.small, .small p, .small label, ul.small, a.small {
line-height:1.4em;
}
+p.small_choices, .small_choices p, .small_choices label, ul.small_choices, a.small_choices {
+ font-size:0.8125em;
+ line-height:1.0em;
+}
+
p.tiny, .tiny p, .tiny label, ul.tiny, a.tiny {
font-size:0.6875em;
View
BIN dsp/mediaroot/img/extra/arrow.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN dsp/mediaroot/img/extra/minus.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN dsp/mediaroot/img/extra/please_select.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN dsp/mediaroot/small/technologies/Icon_activated_sludge.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN dsp/mediaroot/small/technologies/Icon_aerated_pond.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN dsp/mediaroot/small/technologies/Icon_anaerobic_baffled_reactor.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN dsp/mediaroot/small/technologies/Icon_anaerobic_baffled_reactor_2.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN dsp/mediaroot/small/technologies/Icon_anaerobic_biogas_reactor.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN dsp/mediaroot/small/technologies/Icon_anaerobic_filter.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN dsp/mediaroot/small/technologies/Icon_application_of_compost_eco_humus.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN dsp/mediaroot/small/technologies/Icon_application_of_dehydrated_faeces.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN dsp/mediaroot/small/technologies/Icon_application_of_urine.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN dsp/mediaroot/small/technologies/Icon_aquaculture_ponds.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN dsp/mediaroot/small/technologies/Icon_cistern_flush_toilet.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN dsp/mediaroot/small/technologies/Icon_co-composting.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN dsp/mediaroot/small/technologies/Icon_composting_chamber.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN dsp/mediaroot/small/technologies/Icon_conventional_gravity_sewer.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN dsp/mediaroot/small/technologies/Icon_dehydration_vault.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN dsp/mediaroot/small/technologies/Icon_dehydration_vaults_2.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN dsp/mediaroot/small/technologies/Icon_double_ventilated_improved_pit.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN dsp/mediaroot/small/technologies/Icon_dry_toilet.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN dsp/mediaroot/small/technologies/Icon_fill_and_cover_arborloo.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN dsp/mediaroot/small/technologies/Icon_floating_plant_macrophyte_pond.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN dsp/mediaroot/small/technologies/Icon_fossa_alterna.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN dsp/mediaroot/small/technologies/Icon_free-water_surface_constructed_wetland.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN dsp/mediaroot/small/technologies/Icon_horizontal_subsurface_flow_constructed_wetland.png
Diff not rendered.
View
BIN dsp/mediaroot/small/technologies/Icon_human_powered_emptying_and_transport.png
Diff not rendered.
View
BIN dsp/mediaroot/small/technologies/Icon_irrigation.png
Diff not rendered.
View
BIN dsp/mediaroot/small/technologies/Icon_jerrycan_tank.png
Diff not rendered.
View
BIN dsp/mediaroot/small/technologies/Icon_land_application_of_sludge.png
Diff not rendered.
View
BIN dsp/mediaroot/small/technologies/Icon_leach_field.png
Diff not rendered.
View
BIN dsp/mediaroot/small/technologies/Icon_motorized_emptying_and_transport.png
Diff not rendered.
View
BIN dsp/mediaroot/small/technologies/Icon_planted_drying_beds.png
Diff not rendered.
View
BIN dsp/mediaroot/small/technologies/Icon_pour_flush_toilet.png
Diff not rendered.
View
BIN dsp/mediaroot/small/technologies/Icon_sedimentation_thickening_ponds.png
Diff not rendered.
View
BIN dsp/mediaroot/small/technologies/Icon_septic_tank.png
Diff not rendered.
View
BIN dsp/mediaroot/small/technologies/Icon_septic_tank_2.png
Diff not rendered.
View
BIN dsp/mediaroot/small/technologies/Icon_sewer_discharge_station.png
Diff not rendered.
View
BIN dsp/mediaroot/small/technologies/Icon_simplified_sewers.png
Diff not rendered.
View
BIN dsp/mediaroot/small/technologies/Icon_single_pit.png
Diff not rendered.
View
BIN dsp/mediaroot/small/technologies/Icon_single_ventilated_improved_pit.png
Diff not rendered.
View
BIN dsp/mediaroot/small/technologies/Icon_soak_pit.png
Diff not rendered.
View
BIN dsp/mediaroot/small/technologies/Icon_solids_free_sewer.png
Diff not rendered.
View
BIN dsp/mediaroot/small/technologies/Icon_surface_disposal.png
Diff not rendered.
View
BIN dsp/mediaroot/small/technologies/Icon_transfer_station_underground_holding_tank.png
Diff not rendered.
View
BIN dsp/mediaroot/small/technologies/Icon_trickling_filter.png
Diff not rendered.
View
BIN dsp/mediaroot/small/technologies/Icon_twin_pits_for_pour_flush.png
Diff not rendered.
View
BIN dsp/mediaroot/small/technologies/Icon_unplanted_drying_beds.png
Diff not rendered.
View
BIN dsp/mediaroot/small/technologies/Icon_upflow_anaerobic_sludge_blanket_reactor.png
Diff not rendered.
View
BIN dsp/mediaroot/small/technologies/Icon_urinal.png
Diff not rendered.
View
BIN dsp/mediaroot/small/technologies/Icon_urine_diverting_dry_toilet.png
Diff not rendered.
View
BIN dsp/mediaroot/small/technologies/Icon_urine_diverting_flush_toilet.png
Diff not rendered.
View
BIN dsp/mediaroot/small/technologies/Icon_urine_storage_tank_container.png
Diff not rendered.
View
BIN dsp/mediaroot/small/technologies/Icon_vertical_flow_constructed_wetland.png
Diff not rendered.
View
BIN dsp/mediaroot/small/technologies/Icon_waste_stabilization_ponds.png
Diff not rendered.
View
BIN dsp/mediaroot/small/technologies/Icon_water_disposal_groundwater_recharge.png
Diff not rendered.
View
BIN dsp/mediaroot/technologies/Icon_activated_sludge.png
Diff not rendered.
View
BIN dsp/mediaroot/technologies/Icon_aerated_pond.png
Diff not rendered.
View
BIN dsp/mediaroot/technologies/Icon_anaerobic_baffled_reactor.png
Diff not rendered.
View
BIN dsp/mediaroot/technologies/Icon_anaerobic_baffled_reactor_2.png
Diff not rendered.
View
BIN dsp/mediaroot/technologies/Icon_anaerobic_biogas_reactor.png
Diff not rendered.
View
BIN dsp/mediaroot/technologies/Icon_anaerobic_filter.png
Diff not rendered.
View
BIN dsp/mediaroot/technologies/Icon_application_of_compost_eco_humus.png
Diff not rendered.
View
BIN dsp/mediaroot/technologies/Icon_application_of_dehydrated_faeces.png
Diff not rendered.
View
BIN dsp/mediaroot/technologies/Icon_application_of_urine.png
Diff not rendered.
View
BIN dsp/mediaroot/technologies/Icon_aquaculture_ponds.png
Diff not rendered.
View
BIN dsp/mediaroot/technologies/Icon_cistern_flush_toilet.png
Diff not rendered.
View
BIN dsp/mediaroot/technologies/Icon_co-composting.png
Diff not rendered.
View
BIN dsp/mediaroot/technologies/Icon_composting_chamber.png
Diff not rendered.
View
BIN dsp/mediaroot/technologies/Icon_conventional_gravity_sewer.png
Diff not rendered.
View
BIN dsp/mediaroot/technologies/Icon_dehydration_vault.png
Diff not rendered.
View
BIN dsp/mediaroot/technologies/Icon_dehydration_vaults_2.png
Diff not rendered.
View
BIN dsp/mediaroot/technologies/Icon_double_ventilated_improved_pit.png
Diff not rendered.
View
BIN dsp/mediaroot/technologies/Icon_dry_toilet.png
Diff not rendered.
View
BIN dsp/mediaroot/technologies/Icon_fill_and_cover_arborloo.png
Diff not rendered.
View
BIN dsp/mediaroot/technologies/Icon_floating_plant_macrophyte_pond.png
Diff not rendered.
View
BIN dsp/mediaroot/technologies/Icon_fossa_alterna.png
Diff not rendered.
View
BIN dsp/mediaroot/technologies/Icon_free-water_surface_constructed_wetland.png
Diff not rendered.
View
BIN dsp/mediaroot/technologies/Icon_horizontal_subsurface_flow_constructed_wetland.png
Diff not rendered.
View
BIN dsp/mediaroot/technologies/Icon_human_powered_emptying_and_transport.png
Diff not rendered.
View
BIN dsp/mediaroot/technologies/Icon_irrigation.png
Diff not rendered.
View
BIN dsp/mediaroot/technologies/Icon_jerrycan_tank.png
Diff not rendered.
View
BIN dsp/mediaroot/technologies/Icon_land_application_of_sludge.png
Diff not rendered.
View
BIN dsp/mediaroot/technologies/Icon_leach_field.png
Diff not rendered.
View
BIN dsp/mediaroot/technologies/Icon_motorized_emptying_and_transport.png
Diff not rendered.
View
BIN dsp/mediaroot/technologies/Icon_planted_drying_beds.png
Diff not rendered.
View
BIN dsp/mediaroot/technologies/Icon_pour_flush_toilet.png
Diff not rendered.
View
BIN dsp/mediaroot/technologies/Icon_sedimentation_thickening_ponds.png
Diff not rendered.
View
BIN dsp/mediaroot/technologies/Icon_septic_tank.png
Diff not rendered.
View
BIN dsp/mediaroot/technologies/Icon_septic_tank_2.png
Diff not rendered.
View
BIN dsp/mediaroot/technologies/Icon_sewer_discharge_station.png
Diff not rendered.
View
BIN dsp/mediaroot/technologies/Icon_simplified_sewers.png
Diff not rendered.
View
BIN dsp/mediaroot/technologies/Icon_single_pit.png
Diff not rendered.
View
BIN dsp/mediaroot/technologies/Icon_single_ventilated_improved_pit.png
Diff not rendered.
View
BIN dsp/mediaroot/technologies/Icon_soak_pit.png
Diff not rendered.
View
BIN dsp/mediaroot/technologies/Icon_solids_free_sewer.png
Diff not rendered.
View
BIN dsp/mediaroot/technologies/Icon_surface_disposal.png
Diff not rendered.
View
BIN dsp/mediaroot/technologies/Icon_transfer_station_underground_holding_tank.png
Diff not rendered.
View
BIN dsp/mediaroot/technologies/Icon_trickling_filter.png
Diff not rendered.
View
BIN dsp/mediaroot/technologies/Icon_twin_pits_for_pour_flush.png
Diff not rendered.
View
BIN dsp/mediaroot/technologies/Icon_unplanted_drying_beds.png
Diff not rendered.
View
BIN dsp/mediaroot/technologies/Icon_upflow_anaerobic_sludge_blanket_reactor.png
Diff not rendered.
View
BIN dsp/mediaroot/technologies/Icon_urinal.png
Diff not rendered.
View
BIN dsp/mediaroot/technologies/Icon_urine_diverting_dry_toilet.png
Diff not rendered.
View
BIN dsp/mediaroot/technologies/Icon_urine_diverting_flush_toilet.png
Diff not rendered.
View
BIN dsp/mediaroot/technologies/Icon_urine_storage_tank_container.png
Diff not rendered.
View
BIN dsp/mediaroot/technologies/Icon_vertical_flow_constructed_wetland.png
Diff not rendered.
View
BIN dsp/mediaroot/technologies/Icon_waste_stabilization_ponds.png
Diff not rendered.
View
BIN dsp/mediaroot/technologies/Icon_water_disposal_groundwater_recharge.png
Diff not rendered.

No commit comments for this range

Something went wrong with that request. Please try again.