projects changes
This commit is contained in:
commit
77eb530663
|
@ -145,6 +145,4 @@
|
|||
<li><img src="/static/images/dummy1.jpg" width="100" height="100" class="selected"></li>
|
||||
-->
|
||||
</ul>
|
||||
{% endblock %}
|
||||
|
||||
|
||||
{% endblock %}
|
|
@ -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
|
||||
|
|
|
@ -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", {})
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user