This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description

create_thumbs template tag

Parse your text on fly, finds images urls and replace it by thumb url:

{% load sorl_hacks %}

{% for text_block in post.blocks.all %}
    <h4>{{ text_block }}</h4>
    <p>{{ text_block.body|create_thumbs|safe }}</p>
    <hr>
{% endfor %}

ThumbedCkeditorImages

Admin model mixin with post_save replacing.

admin.py:

from sorl_hacks.admin import ThumbedCkeditorImages

class BlogPostAdmin(ThumbedCkeditorImages):
    ...

ThumbMixin

Usefull in stadart Django templates. Add property my_model.get_thumb_WIDTHxHEIGHT to yours models.

Example of my_model_detail.html:

{{ my_model.get_thumb_200x200.html }}

{{ my_model.get_thumb_small.html }}

instead of:

{% thumbnail my_model.pic "56x56" crop="center" as im %}
    <img src="{{ im.url }}" width="56" height="56">
{% empty %}
    <img src="{{ MISSING_IMAGE }}" width="56" height="56">
{% endthumbnail %}

INSTALL

Your models.py:

from django.db import models
from sorl.thumbnail import ImageField
from sorl_hacks.models import ThumbMixin

class Post(ThumbMixin, models.Model):
    image = ImageField('image', upload_to='posts', **nullable)
Release History

Release History

0.1.10

This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.1

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
django-sorl-hacks-0.1.10.tar.gz (4.9 kB) Copy SHA256 Checksum SHA256 Source Sep 3, 2014

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS HPE HPE Development Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting