Skip to content

vixh/django-imageofmodel

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Simple Django image holder for Model.

USAGE

settings.py:
Add to INSTALLED_APPS 'imageofmodel'
./manage syncdb

models.py:
from imageofmodel.models import ImageOfModel
from django.contrib.contenttypes import generic
images = generic.GenericRelation(ImageOfModel)

admin.py:
from imageofmodel.admin import ImageOfModelInline OR OneImageOfModelInline FOR one image only
inlines = (ImageOfModelInline, )

template.html
Main image <img src='model.images.main_image.thumbnail_image.url'/>
Check specs.py for more image's sizes (thumbnail_image, small_thumbnail_image, display, original_image)

About

Django app to holds images for models

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages