Created
September 21, 2011 16:51
-
-
Save jakab922/1232628 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# views.py | |
def landlords(request, lang_code): | |
template_dict = generate_base_dict(lang_code, '/landlords/') | |
template_dict['previous_developments'] = [TestimonialDummy('/static/images/prev_dev_thumb1.jpg', 'Cadwell House, London SW13') for i in range(3)] | |
template_dict['three_element'] = [i for i in range(1,4)] | |
return render_to_response('pages/landlords.html', template_dict, context_instance = RequestContext(request)) | |
class TestimonialDummy(): | |
def __init__(self, thumbnail, address): | |
self.thumbnail = thumbnail | |
self.address = address | |
def __str__(self): | |
return str((self.thumbnail, self.address)) | |
# landlords.html template interesting part | |
{% for previous_development in previous_developments %} <!-- TODO: Table need to be created for this. --> | |
<li> | |
<a href="#"><img src="{{ STATIC_URL }}{{ previous_development.thumbnail }}" alt="{% gettext landlords-Previous_development_alt %}"></a> | |
<strong>{{ previous_development.address }}</strong> | |
</li> | |
{% endfor %} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment