projects changes

This commit is contained in:
Karen 2011-10-05 17:32:49 +05:30
commit 77eb530663
3 changed files with 5 additions and 4 deletions

View File

@ -145,6 +145,4 @@
<li><img src="/static/images/dummy1.jpg" width="100" height="100" class="selected"></li>
-->
</ul>
{% endblock %}
{% endblock %}

View File

@ -1,5 +1,6 @@
from django.db import models
from os.path import join
from sorl.thumbnail import get_thumbnail
def project_thumb_path(instance, filename):
return join('project_thumbs', instance.slug, filename)
@ -32,8 +33,9 @@ class Project(models.Model):
def get_images(self):
imgs = []
for i in self.projectimage_set.all():
image_url = get_thumbnail(i.image, "x450", crop="center").url
imgs.append({
'url': i.image.url,
'url': image_url,
'caption': i.caption
})
return imgs

View File

@ -4,6 +4,7 @@ from models import *
import json
from ox.django.shortcuts import render_to_json_response
def home(request):
return render_to_response("home.html", {})