add imagestore code / model modification / form

This commit is contained in:
Sanj 2012-08-31 15:57:50 +05:30
parent 74ab5043d0
commit 254c6924a6
69 changed files with 4416 additions and 8 deletions

View File

36
itf/imagestore/admin.py Normal file
View File

@ -0,0 +1,36 @@
from django.contrib import admin
from imagestore.models import Image, Album, AlbumUpload
from sorl.thumbnail.admin import AdminImageMixin, AdminInlineImageMixin
from django.conf import settings
class InlineImageAdmin(AdminInlineImageMixin, admin.TabularInline):
model = Image
fieldsets = ((None, {'fields': ['image', 'user', 'title', 'order', 'tags', 'album']}),)
raw_id_fields = ('user', )
extra = 0
class AlbumAdmin(admin.ModelAdmin):
fieldsets = ((None, {'fields': ['name', 'user', 'is_public', 'order']}),)
list_display = ('name', 'admin_thumbnail','user', 'created', 'updated', 'is_public', 'order')
list_editable = ('order', )
inlines = [InlineImageAdmin]
admin.site.register(Album, AlbumAdmin)
class ImageAdmin(admin.ModelAdmin):
fieldsets = ((None, {'fields': ['user', 'title', 'image', 'description', 'order', 'tags', 'album']}),)
list_display = ('admin_thumbnail', 'user', 'order', 'album', 'title')
raw_id_fields = ('user', )
list_filter = ('album', )
class AlbumUploadAdmin(admin.ModelAdmin):
def has_change_permission(self, request, obj=None):
return False
IMAGE_MODEL = getattr(settings, 'IMAGESTORE_IMAGE_MODEL', None)
if not IMAGE_MODEL:
admin.site.register(Image, ImageAdmin)
ALBUM_MODEL = getattr(settings, 'IMAGESTORE_ALBUM_MODEL', None)
if not ALBUM_MODEL:
admin.site.register(AlbumUpload, AlbumUploadAdmin)

View File

@ -0,0 +1,29 @@
#!/usr/bin/env python
# vim:fileencoding=utf-8
from django.core.urlresolvers import reverse, NoReverseMatch
from django.conf import settings
from utils import get_model_string
from imagestore.models import image_applabel, image_classname
from imagestore.models import album_applabel, album_classname
def imagestore_processor(request):
template = getattr(settings, 'IMAGESTORE_TEMPLATE', False)
ret = {
'IMAGESTORE_SHOW_USER': getattr(settings, 'IMAGESTORE_SHOW_USER', True),
'IMAGESTORE_SHOW_TAGS': getattr(settings, 'IMAGESTORE_SHOW_TAGS', True),
'IMAGESTORE_MODEL_STRING': get_model_string('Image'),
'IMAGESTORE_LOAD_CSS': getattr(settings, 'IMAGESTORE_LOAD_CSS', True),
}
try:
ret['imagestore_index_url'] = reverse('imagestore:index')
except NoReverseMatch: #Bastard django-cms from hell!!!!111
pass
if template:
ret['IMAGESTORE_TEMPLATE'] = template
ret['imagestore_perms'] = {
'add_image': request.user.has_perm('%s.add_%s' % (image_applabel, image_classname)),
'add_album': request.user.has_perm('%s.add_%s' % (album_applabel, album_classname)),
}
return ret

36
itf/imagestore/forms.py Normal file
View File

@ -0,0 +1,36 @@
#!/usr/bin/env python
# vim:fileencoding=utf-8
__author__ = 'zeus'
from django import forms
from models import Image, Album
from django.utils.translation import ugettext_lazy as _
from utils import load_class
from django.conf import settings
class ImageForm(forms.ModelForm):
class Meta(object):
model = Image
exclude = ('user', 'order')
description = forms.CharField(widget=forms.Textarea(attrs={'rows': 2, 'cols': 19}), required=False,
label=_('Description'))
def __init__(self, user, *args, **kwargs):
super(ImageForm, self).__init__(*args, **kwargs)
self.fields['album'].queryset = Album.objects.filter(user=user)
self.fields['album'].required = True
class AlbumForm(forms.ModelForm):
class Meta(object):
model = Album
exclude = ('user', 'created', 'updated')
def __init__(self, *args, **kwargs):
super(AlbumForm, self).__init__(*args, **kwargs)
if 'instance' in kwargs and kwargs['instance']:
self.fields['head'].queryset = Image.objects.filter(album=kwargs['instance'])
else:
self.fields['head'].widget = forms.HiddenInput()

View File

@ -0,0 +1,5 @@
#!/usr/bin/env python
# vim:fileencoding=utf-8
__author__ = 'zeus'

View File

@ -0,0 +1,15 @@
#!/usr/bin/env python
# vim:fileencoding=utf-8
__author__ = 'zeus'
from cms.app_base import CMSApp
from cms.apphook_pool import apphook_pool
from django.utils.translation import ugettext_lazy as _
class ImagestoreApp(CMSApp):
name = _("Imagestore App") # give your app a name, this is required
urls = ["imagestore.imagestore_cms.urls"] # link your app to url configuration(s)
apphook_pool.register(ImagestoreApp) # register your app

View File

@ -0,0 +1,53 @@
#!/usr/bin/env python
# vim:fileencoding=utf-8
__author__ = 'zeus'
from cms.plugin_base import CMSPluginBase
from cms.plugin_pool import plugin_pool
from models import ImagestoreAlbumPtr, ImagestoreAlbumCarousel
from django.utils.translation import ugettext_lazy as _
from django.conf import settings
class AlbumPlugin(CMSPluginBase):
model = ImagestoreAlbumPtr
name = _('Album')
render_template = "cms/plugins/imagestore_album.html"
text_enabled = True
def render(self, context, instance, placeholder):
context.update({'album': instance.album})
return context
class AlbumCarouselPlugin(CMSPluginBase):
model = ImagestoreAlbumCarousel
name = _('Album as carousel')
render_template = "cms/plugins/imagestore_album_carousel.html"
text_enabled = True
def render(self, context, instance, placeholder):
# default carousel template in the settings file
carousel_template = getattr(settings, 'IMAGESTORE_CAROUSEL_TEMPLATE', None)
if carousel_template:
self.render_template = carousel_template
if instance.template_file:
self.render_template = instance.template_file
else:
if carousel_template:
instance.template_file = carousel_template
else:
instance.template_file = self.render_template
instance.save()
images = instance.album.images.all()
if instance.limit:
images = images[:instance.limit]
context.update({'images': images, 'carousel': instance})
return context
plugin_pool.register_plugin(AlbumCarouselPlugin)
plugin_pool.register_plugin(AlbumPlugin)

View File

@ -0,0 +1,112 @@
# encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'ImagestoreAlbumPtr'
db.create_table('cmsplugin_imagestorealbumptr', (
('cmsplugin_ptr', self.gf('django.db.models.fields.related.OneToOneField')(to=orm['cms.CMSPlugin'], unique=True, primary_key=True)),
('album', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['imagestore.Album'])),
))
db.send_create_signal('imagestore_cms', ['ImagestoreAlbumPtr'])
def backwards(self, orm):
# Deleting model 'ImagestoreAlbumPtr'
db.delete_table('cmsplugin_imagestorealbumptr')
models = {
'auth.group': {
'Meta': {'object_name': 'Group'},
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}),
'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'})
},
'auth.permission': {
'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'},
'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '50'})
},
'auth.user': {
'Meta': {'object_name': 'User'},
'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}),
'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}),
'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'})
},
'cms.cmsplugin': {
'Meta': {'object_name': 'CMSPlugin'},
'creation_date': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'language': ('django.db.models.fields.CharField', [], {'max_length': '15', 'db_index': 'True'}),
'level': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}),
'lft': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}),
'parent': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['cms.CMSPlugin']", 'null': 'True', 'blank': 'True'}),
'placeholder': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['cms.Placeholder']", 'null': 'True'}),
'plugin_type': ('django.db.models.fields.CharField', [], {'max_length': '50', 'db_index': 'True'}),
'position': ('django.db.models.fields.PositiveSmallIntegerField', [], {'null': 'True', 'blank': 'True'}),
'rght': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}),
'tree_id': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'})
},
'cms.placeholder': {
'Meta': {'object_name': 'Placeholder'},
'default_width': ('django.db.models.fields.PositiveSmallIntegerField', [], {'null': 'True'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'slot': ('django.db.models.fields.CharField', [], {'max_length': '50', 'db_index': 'True'})
},
'contenttypes.contenttype': {
'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"},
'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '100'})
},
'imagestore.album': {
'Meta': {'ordering': "('created', 'name')", 'object_name': 'Album'},
'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
'head': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'head_of'", 'null': 'True', 'to': "orm['imagestore.Image']"}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'is_public': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '20'}),
'updated': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
'user': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'albums'", 'null': 'True', 'to': "orm['auth.User']"})
},
'imagestore.image': {
'Meta': {'ordering': "('order', 'id')", 'object_name': 'Image'},
'album': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'images'", 'null': 'True', 'to': "orm['imagestore.Album']"}),
'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'null': 'True', 'blank': 'True'}),
'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'image': ('sorl.thumbnail.fields.ImageField', [], {'max_length': '100'}),
'order': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
'tags': ('tagging.fields.TagField', [], {}),
'title': ('django.db.models.fields.CharField', [], {'max_length': '20', 'null': 'True', 'blank': 'True'}),
'updated': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'null': 'True', 'blank': 'True'}),
'user': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'images'", 'null': 'True', 'to': "orm['auth.User']"})
},
'imagestore_cms.imagestorealbumptr': {
'Meta': {'object_name': 'ImagestoreAlbumPtr', 'db_table': "'cmsplugin_imagestorealbumptr'", '_ormbases': ['cms.CMSPlugin']},
'album': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['imagestore.Album']"}),
'cmsplugin_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['cms.CMSPlugin']", 'unique': 'True', 'primary_key': 'True'})
}
}
complete_apps = ['imagestore_cms']

View File

@ -0,0 +1,121 @@
# encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'ImagestoreAlbumCarusel'
db.create_table('cmsplugin_imagestorealbumcarusel', (
('cmsplugin_ptr', self.gf('django.db.models.fields.related.OneToOneField')(to=orm['cms.CMSPlugin'], unique=True, primary_key=True)),
('album', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['imagestore.Album'])),
('width', self.gf('django.db.models.fields.IntegerField')(default=200)),
('limit', self.gf('django.db.models.fields.IntegerField')(null=True, blank=True)),
))
db.send_create_signal('imagestore_cms', ['ImagestoreAlbumCarusel'])
def backwards(self, orm):
# Deleting model 'ImagestoreAlbumCarusel'
db.delete_table('cmsplugin_imagestorealbumcarusel')
models = {
'auth.group': {
'Meta': {'object_name': 'Group'},
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}),
'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'})
},
'auth.permission': {
'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'},
'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '50'})
},
'auth.user': {
'Meta': {'object_name': 'User'},
'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}),
'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}),
'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'})
},
'cms.cmsplugin': {
'Meta': {'object_name': 'CMSPlugin'},
'creation_date': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'language': ('django.db.models.fields.CharField', [], {'max_length': '15', 'db_index': 'True'}),
'level': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}),
'lft': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}),
'parent': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['cms.CMSPlugin']", 'null': 'True', 'blank': 'True'}),
'placeholder': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['cms.Placeholder']", 'null': 'True'}),
'plugin_type': ('django.db.models.fields.CharField', [], {'max_length': '50', 'db_index': 'True'}),
'position': ('django.db.models.fields.PositiveSmallIntegerField', [], {'null': 'True', 'blank': 'True'}),
'rght': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}),
'tree_id': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'})
},
'cms.placeholder': {
'Meta': {'object_name': 'Placeholder'},
'default_width': ('django.db.models.fields.PositiveSmallIntegerField', [], {'null': 'True'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'slot': ('django.db.models.fields.CharField', [], {'max_length': '50', 'db_index': 'True'})
},
'contenttypes.contenttype': {
'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"},
'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '100'})
},
'imagestore.album': {
'Meta': {'ordering': "('created', 'name')", 'object_name': 'Album'},
'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
'head': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'head_of'", 'null': 'True', 'to': "orm['imagestore.Image']"}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'is_public': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '20'}),
'updated': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
'user': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'albums'", 'null': 'True', 'to': "orm['auth.User']"})
},
'imagestore.image': {
'Meta': {'ordering': "('order', 'id')", 'object_name': 'Image'},
'album': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'images'", 'null': 'True', 'to': "orm['imagestore.Album']"}),
'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'null': 'True', 'blank': 'True'}),
'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'image': ('sorl.thumbnail.fields.ImageField', [], {'max_length': '100'}),
'order': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
'tags': ('tagging.fields.TagField', [], {}),
'title': ('django.db.models.fields.CharField', [], {'max_length': '20', 'null': 'True', 'blank': 'True'}),
'updated': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'null': 'True', 'blank': 'True'}),
'user': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'images'", 'null': 'True', 'to': "orm['auth.User']"})
},
'imagestore_cms.imagestorealbumcarusel': {
'Meta': {'object_name': 'ImagestoreAlbumCarusel', 'db_table': "'cmsplugin_imagestorealbumcarusel'", '_ormbases': ['cms.CMSPlugin']},
'album': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['imagestore.Album']"}),
'cmsplugin_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['cms.CMSPlugin']", 'unique': 'True', 'primary_key': 'True'}),
'limit': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}),
'width': ('django.db.models.fields.IntegerField', [], {'default': '200'})
},
'imagestore_cms.imagestorealbumptr': {
'Meta': {'object_name': 'ImagestoreAlbumPtr', 'db_table': "'cmsplugin_imagestorealbumptr'", '_ormbases': ['cms.CMSPlugin']},
'album': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['imagestore.Album']"}),
'cmsplugin_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['cms.CMSPlugin']", 'unique': 'True', 'primary_key': 'True'})
}
}
complete_apps = ['imagestore_cms']

View File

@ -0,0 +1,137 @@
# encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Deleting model 'ImagestoreAlbumCarusel'
db.delete_table('cmsplugin_imagestorealbumcarusel')
# Adding model 'ImagestoreAlbumCarousel'
db.create_table('cmsplugin_imagestorealbumcarousel', (
('cmsplugin_ptr', self.gf('django.db.models.fields.related.OneToOneField')(to=orm['cms.CMSPlugin'], unique=True, primary_key=True)),
('album', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['imagestore.Album'])),
('width', self.gf('django.db.models.fields.IntegerField')(default=200)),
('height', self.gf('django.db.models.fields.IntegerField')(default=200)),
('skin', self.gf('django.db.models.fields.CharField')(default='jcarousel-skin-tango', max_length=100)),
('limit', self.gf('django.db.models.fields.IntegerField')(null=True, blank=True)),
))
db.send_create_signal('imagestore_cms', ['ImagestoreAlbumCarousel'])
def backwards(self, orm):
# Adding model 'ImagestoreAlbumCarusel'
db.create_table('cmsplugin_imagestorealbumcarusel', (
('album', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['imagestore.Album'])),
('limit', self.gf('django.db.models.fields.IntegerField')(null=True, blank=True)),
('cmsplugin_ptr', self.gf('django.db.models.fields.related.OneToOneField')(to=orm['cms.CMSPlugin'], unique=True, primary_key=True)),
('width', self.gf('django.db.models.fields.IntegerField')(default=200)),
))
db.send_create_signal('imagestore_cms', ['ImagestoreAlbumCarusel'])
# Deleting model 'ImagestoreAlbumCarousel'
db.delete_table('cmsplugin_imagestorealbumcarousel')
models = {
'auth.group': {
'Meta': {'object_name': 'Group'},
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}),
'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'})
},
'auth.permission': {
'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'},
'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '50'})
},
'auth.user': {
'Meta': {'object_name': 'User'},
'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}),
'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}),
'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'})
},
'cms.cmsplugin': {
'Meta': {'object_name': 'CMSPlugin'},
'creation_date': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'language': ('django.db.models.fields.CharField', [], {'max_length': '15', 'db_index': 'True'}),
'level': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}),
'lft': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}),
'parent': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['cms.CMSPlugin']", 'null': 'True', 'blank': 'True'}),
'placeholder': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['cms.Placeholder']", 'null': 'True'}),
'plugin_type': ('django.db.models.fields.CharField', [], {'max_length': '50', 'db_index': 'True'}),
'position': ('django.db.models.fields.PositiveSmallIntegerField', [], {'null': 'True', 'blank': 'True'}),
'rght': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}),
'tree_id': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'})
},
'cms.placeholder': {
'Meta': {'object_name': 'Placeholder'},
'default_width': ('django.db.models.fields.PositiveSmallIntegerField', [], {'null': 'True'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'slot': ('django.db.models.fields.CharField', [], {'max_length': '50', 'db_index': 'True'})
},
'contenttypes.contenttype': {
'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"},
'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '100'})
},
'imagestore.album': {
'Meta': {'ordering': "('created', 'name')", 'object_name': 'Album'},
'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
'head': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'head_of'", 'null': 'True', 'to': "orm['imagestore.Image']"}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'is_public': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '20'}),
'updated': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
'user': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'albums'", 'null': 'True', 'to': "orm['auth.User']"})
},
'imagestore.image': {
'Meta': {'ordering': "('order', 'id')", 'object_name': 'Image'},
'album': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'images'", 'null': 'True', 'to': "orm['imagestore.Album']"}),
'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'null': 'True', 'blank': 'True'}),
'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'image': ('sorl.thumbnail.fields.ImageField', [], {'max_length': '100'}),
'order': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
'tags': ('tagging.fields.TagField', [], {}),
'title': ('django.db.models.fields.CharField', [], {'max_length': '20', 'null': 'True', 'blank': 'True'}),
'updated': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'null': 'True', 'blank': 'True'}),
'user': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'images'", 'null': 'True', 'to': "orm['auth.User']"})
},
'imagestore_cms.imagestorealbumcarousel': {
'Meta': {'object_name': 'ImagestoreAlbumCarousel', 'db_table': "'cmsplugin_imagestorealbumcarousel'", '_ormbases': ['cms.CMSPlugin']},
'album': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['imagestore.Album']"}),
'cmsplugin_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['cms.CMSPlugin']", 'unique': 'True', 'primary_key': 'True'}),
'height': ('django.db.models.fields.IntegerField', [], {'default': '200'}),
'limit': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}),
'skin': ('django.db.models.fields.CharField', [], {'default': "'jcarousel-skin-tango'", 'max_length': '100'}),
'width': ('django.db.models.fields.IntegerField', [], {'default': '200'})
},
'imagestore_cms.imagestorealbumptr': {
'Meta': {'object_name': 'ImagestoreAlbumPtr', 'db_table': "'cmsplugin_imagestorealbumptr'", '_ormbases': ['cms.CMSPlugin']},
'album': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['imagestore.Album']"}),
'cmsplugin_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['cms.CMSPlugin']", 'unique': 'True', 'primary_key': 'True'})
}
}
complete_apps = ['imagestore_cms']

View File

@ -0,0 +1,135 @@
# encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Deleting field 'ImagestoreAlbumCarousel.height'
db.delete_column('cmsplugin_imagestorealbumcarousel', 'height')
# Deleting field 'ImagestoreAlbumCarousel.width'
db.delete_column('cmsplugin_imagestorealbumcarousel', 'width')
# Adding field 'ImagestoreAlbumCarousel.size'
db.add_column('cmsplugin_imagestorealbumcarousel', 'size', self.gf('django.db.models.fields.CharField')(default='72x72', max_length=20), keep_default=False)
# Adding field 'ImagestoreAlbumCarousel.full_size'
db.add_column('cmsplugin_imagestorealbumcarousel', 'full_size', self.gf('django.db.models.fields.CharField')(default='600x600', max_length=20), keep_default=False)
def backwards(self, orm):
# Adding field 'ImagestoreAlbumCarousel.height'
db.add_column('cmsplugin_imagestorealbumcarousel', 'height', self.gf('django.db.models.fields.IntegerField')(default=200), keep_default=False)
# Adding field 'ImagestoreAlbumCarousel.width'
db.add_column('cmsplugin_imagestorealbumcarousel', 'width', self.gf('django.db.models.fields.IntegerField')(default=200), keep_default=False)
# Deleting field 'ImagestoreAlbumCarousel.size'
db.delete_column('cmsplugin_imagestorealbumcarousel', 'size')
# Deleting field 'ImagestoreAlbumCarousel.full_size'
db.delete_column('cmsplugin_imagestorealbumcarousel', 'full_size')
models = {
'auth.group': {
'Meta': {'object_name': 'Group'},
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}),
'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'})
},
'auth.permission': {
'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'},
'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '50'})
},
'auth.user': {
'Meta': {'object_name': 'User'},
'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}),
'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}),
'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'})
},
'cms.cmsplugin': {
'Meta': {'object_name': 'CMSPlugin'},
'creation_date': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'language': ('django.db.models.fields.CharField', [], {'max_length': '15', 'db_index': 'True'}),
'level': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}),
'lft': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}),
'parent': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['cms.CMSPlugin']", 'null': 'True', 'blank': 'True'}),
'placeholder': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['cms.Placeholder']", 'null': 'True'}),
'plugin_type': ('django.db.models.fields.CharField', [], {'max_length': '50', 'db_index': 'True'}),
'position': ('django.db.models.fields.PositiveSmallIntegerField', [], {'null': 'True', 'blank': 'True'}),
'rght': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}),
'tree_id': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'})
},
'cms.placeholder': {
'Meta': {'object_name': 'Placeholder'},
'default_width': ('django.db.models.fields.PositiveSmallIntegerField', [], {'null': 'True'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'slot': ('django.db.models.fields.CharField', [], {'max_length': '50', 'db_index': 'True'})
},
'contenttypes.contenttype': {
'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"},
'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '100'})
},
'imagestore.album': {
'Meta': {'ordering': "('created', 'name')", 'object_name': 'Album'},
'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
'head': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'head_of'", 'null': 'True', 'to': "orm['imagestore.Image']"}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'is_public': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '20'}),
'updated': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
'user': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'albums'", 'null': 'True', 'to': "orm['auth.User']"})
},
'imagestore.image': {
'Meta': {'ordering': "('order', 'id')", 'object_name': 'Image'},
'album': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'images'", 'null': 'True', 'to': "orm['imagestore.Album']"}),
'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'null': 'True', 'blank': 'True'}),
'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'image': ('sorl.thumbnail.fields.ImageField', [], {'max_length': '100'}),
'order': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
'tags': ('tagging.fields.TagField', [], {}),
'title': ('django.db.models.fields.CharField', [], {'max_length': '20', 'null': 'True', 'blank': 'True'}),
'updated': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'null': 'True', 'blank': 'True'}),
'user': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'images'", 'null': 'True', 'to': "orm['auth.User']"})
},
'imagestore_cms.imagestorealbumcarousel': {
'Meta': {'object_name': 'ImagestoreAlbumCarousel', 'db_table': "'cmsplugin_imagestorealbumcarousel'", '_ormbases': ['cms.CMSPlugin']},
'album': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['imagestore.Album']"}),
'cmsplugin_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['cms.CMSPlugin']", 'unique': 'True', 'primary_key': 'True'}),
'full_size': ('django.db.models.fields.CharField', [], {'default': "'600x600'", 'max_length': '20'}),
'limit': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}),
'size': ('django.db.models.fields.CharField', [], {'default': "'72x72'", 'max_length': '20'}),
'skin': ('django.db.models.fields.CharField', [], {'default': "'jcarousel-skin-tango'", 'max_length': '100'})
},
'imagestore_cms.imagestorealbumptr': {
'Meta': {'object_name': 'ImagestoreAlbumPtr', 'db_table': "'cmsplugin_imagestorealbumptr'", '_ormbases': ['cms.CMSPlugin']},
'album': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['imagestore.Album']"}),
'cmsplugin_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['cms.CMSPlugin']", 'unique': 'True', 'primary_key': 'True'})
}
}
complete_apps = ['imagestore_cms']

View File

@ -0,0 +1,210 @@
# encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'ImagestoreAlbumCarousel.template_file'
db.add_column('cmsplugin_imagestorealbumcarousel', 'template_file', self.gf('django.db.models.fields.CharField')(default='cms/plugins/imagestore_album_carousel.html', max_length=100), keep_default=False)
def backwards(self, orm):
# Deleting field 'ImagestoreAlbumCarousel.template_file'
db.delete_column('cmsplugin_imagestorealbumcarousel', 'template_file')
models = {
'auth.group': {
'Meta': {'object_name': 'Group'},
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}),
'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'})
},
'auth.permission': {
'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'},
'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '50'})
},
'auth.user': {
'Meta': {'object_name': 'User'},
'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}),
'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}),
'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'})
},
'cms.cmsplugin': {
'Meta': {'object_name': 'CMSPlugin'},
'creation_date': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'language': ('django.db.models.fields.CharField', [], {'max_length': '15', 'db_index': 'True'}),
'level': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}),
'lft': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}),
'parent': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['cms.CMSPlugin']", 'null': 'True', 'blank': 'True'}),
'placeholder': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['cms.Placeholder']", 'null': 'True'}),
'plugin_type': ('django.db.models.fields.CharField', [], {'max_length': '50', 'db_index': 'True'}),
'position': ('django.db.models.fields.PositiveSmallIntegerField', [], {'null': 'True', 'blank': 'True'}),
'rght': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}),
'tree_id': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'})
},
'cms.placeholder': {
'Meta': {'object_name': 'Placeholder'},
'default_width': ('django.db.models.fields.PositiveSmallIntegerField', [], {'null': 'True'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'slot': ('django.db.models.fields.CharField', [], {'max_length': '50', 'db_index': 'True'})
},
'contenttypes.contenttype': {
'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"},
'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '100'})
},
'image.image': {
'Meta': {'ordering': "('order', 'id')", 'object_name': 'Image', 'db_table': "'imagestore_image'"},
'album': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'images'", 'null': 'True', 'to': "orm['imagestore.Album']"}),
'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'null': 'True', 'blank': 'True'}),
'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'image': ('sorl.thumbnail.fields.ImageField', [], {'max_length': '100'}),
'order': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
'place': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'images'", 'null': 'True', 'to': "orm['places.GeoPlace']"}),
'tags': ('tagging.fields.TagField', [], {}),
'title': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}),
'updated': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'null': 'True', 'blank': 'True'}),
'user': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'images'", 'null': 'True', 'to': "orm['auth.User']"})
},
'imagestore.album': {
'Meta': {'ordering': "('created', 'name')", 'object_name': 'Album'},
'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
'head': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'head_of'", 'null': 'True', 'to': "orm['image.Image']"}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'is_public': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
'order': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
'updated': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
'user': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'albums'", 'null': 'True', 'to': "orm['auth.User']"})
},
'imagestore_cms.imagestorealbumcarousel': {
'Meta': {'object_name': 'ImagestoreAlbumCarousel', 'db_table': "'cmsplugin_imagestorealbumcarousel'", '_ormbases': ['cms.CMSPlugin']},
'album': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['imagestore.Album']"}),
'cmsplugin_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['cms.CMSPlugin']", 'unique': 'True', 'primary_key': 'True'}),
'full_size': ('django.db.models.fields.CharField', [], {'default': "'600x600'", 'max_length': '20'}),
'limit': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}),
'size': ('django.db.models.fields.CharField', [], {'default': "'72x72'", 'max_length': '20'}),
'skin': ('django.db.models.fields.CharField', [], {'default': "'jcarousel-skin-tango'", 'max_length': '100'}),
'template_file': ('django.db.models.fields.CharField', [], {'default': "'cms/plugins/imagestore_album_carousel.html'", 'max_length': '100'})
},
'imagestore_cms.imagestorealbumptr': {
'Meta': {'object_name': 'ImagestoreAlbumPtr', 'db_table': "'cmsplugin_imagestorealbumptr'", '_ormbases': ['cms.CMSPlugin']},
'album': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['imagestore.Album']"}),
'cmsplugin_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['cms.CMSPlugin']", 'unique': 'True', 'primary_key': 'True'})
},
'places.geoplace': {
'Meta': {'object_name': 'GeoPlace'},
'addional_info': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),
'address': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}),
'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'imagestore_tag': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}),
'latitude': ('django.db.models.fields.FloatField', [], {'null': 'True', 'blank': 'True'}),
'longtitude': ('django.db.models.fields.FloatField', [], {'null': 'True', 'blank': 'True'}),
'metro': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}),
'minuses': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
'near_objects': ('django.db.models.fields.related.ManyToManyField', [], {'blank': 'True', 'related_name': "'near_objects_rel_+'", 'null': 'True', 'to': "orm['places.GeoPlace']"}),
'near_text': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),
'owner': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'blank': 'True'}),
'path_to': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),
'phone': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}),
'pluses': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),
'private': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
'tags': ('tagging.fields.TagField', [], {}),
'topic': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['pybb.Topic']", 'null': 'True', 'blank': 'True'}),
'topic_on_demand': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
'type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['places.PlaceType']", 'null': 'None', 'blank': 'None'}),
'url': ('django.db.models.fields.URLField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}),
'work_time': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'})
},
'places.placetype': {
'Meta': {'object_name': 'PlaceType'},
'forum': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['pybb.Forum']", 'null': 'True', 'blank': 'True'}),
'forum_user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'blank': 'True'}),
'icon_style': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
'name_plural': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
'path_to_image': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}),
'private': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'slug': ('django.db.models.fields.SlugField', [], {'max_length': '50', 'db_index': 'True'})
},
'pybb.category': {
'Meta': {'ordering': "['position']", 'object_name': 'Category'},
'hidden': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '80'}),
'position': ('django.db.models.fields.IntegerField', [], {'default': '0', 'blank': 'True'})
},
'pybb.forum': {
'Meta': {'ordering': "['position']", 'object_name': 'Forum'},
'category': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'forums'", 'to': "orm['pybb.Category']"}),
'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
'headline': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),
'hidden': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'moderators': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'to': "orm['auth.User']", 'null': 'True', 'blank': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '80'}),
'position': ('django.db.models.fields.IntegerField', [], {'default': '0', 'blank': 'True'}),
'post_count': ('django.db.models.fields.IntegerField', [], {'default': '0', 'blank': 'True'}),
'readed_by': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'readed_forums'", 'symmetrical': 'False', 'through': "orm['pybb.ForumReadTracker']", 'to': "orm['auth.User']"}),
'topic_count': ('django.db.models.fields.IntegerField', [], {'default': '0', 'blank': 'True'}),
'updated': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'})
},
'pybb.forumreadtracker': {
'Meta': {'object_name': 'ForumReadTracker'},
'forum': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['pybb.Forum']", 'null': 'True', 'blank': 'True'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'time_stamp': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"})
},
'pybb.topic': {
'Meta': {'ordering': "['-created']", 'object_name': 'Topic'},
'closed': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'created': ('django.db.models.fields.DateTimeField', [], {'null': 'True'}),
'forum': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'topics'", 'to': "orm['pybb.Forum']"}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
'on_moderation': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'post_count': ('django.db.models.fields.IntegerField', [], {'default': '0', 'blank': 'True'}),
'readed_by': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'readed_topics'", 'symmetrical': 'False', 'through': "orm['pybb.TopicReadTracker']", 'to': "orm['auth.User']"}),
'sticky': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'subscribers': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'related_name': "'subscriptions'", 'blank': 'True', 'to': "orm['auth.User']"}),
'updated': ('django.db.models.fields.DateTimeField', [], {'null': 'True'}),
'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}),
'views': ('django.db.models.fields.IntegerField', [], {'default': '0', 'blank': 'True'})
},
'pybb.topicreadtracker': {
'Meta': {'object_name': 'TopicReadTracker'},
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'time_stamp': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
'topic': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['pybb.Topic']", 'null': 'True', 'blank': 'True'}),
'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"})
}
}
complete_apps = ['imagestore_cms']

View File

@ -0,0 +1,21 @@
#!/usr/bin/env python
# vim:fileencoding=utf-8
__author__ = 'zeus'
from cms.models import CMSPlugin
from django.db import models
from imagestore.models import Album
from django.utils.translation import ugettext_lazy as _
from django.conf import settings
class ImagestoreAlbumPtr(CMSPlugin):
album = models.ForeignKey(Album, verbose_name=_('Album'), blank=False, null=False)
class ImagestoreAlbumCarousel(CMSPlugin):
album = models.ForeignKey(Album, verbose_name=_('Album'), blank=False, null=False)
skin = models.CharField(max_length=100, verbose_name=_('Skin'), default='jcarousel-skin-tango')
limit = models.IntegerField(verbose_name=_('Image limit'), blank=True, null=True)
size = models.CharField(max_length=20, verbose_name=_('Thumbnail size'), default='72x72')
full_size = models.CharField(max_length=20, verbose_name=_('Full size view'), default='600x600')
template_file = models.CharField(max_length=100, verbose_name=_('Template file'), default=getattr(settings,'IMAGESTORE_CAROUSEL_TEMPLATE','cms/plugins/imagestore_album_carousel.html'), blank=True, null=True)

View File

@ -0,0 +1,11 @@
#!/usr/bin/env python
# vim:fileencoding=utf-8
__author__ = 'zeus'
from django.conf.urls.defaults import *
from imagestore.views import AlbumListView
urlpatterns = patterns('',
url(r'^', include('imagestore.urls', namespace='imagestore')),
)

Binary file not shown.

View File

@ -0,0 +1,293 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2011-10-14 04:56+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1)\n"
#: forms.py:18 models.py:95 models/bases/image.py:40
msgid "Description"
msgstr "Descrição"
#: models.py:38 models.py:102 imagestore_cms/cms_plugins.py:13
#: imagestore_cms/models.py:12 imagestore_cms/models.py:15 models/album.py:14
#: models/bases/image.py:47 templates/imagestore/image-scope.html:6
#: templates/imagestore/image_lists/image_list.html:18
msgid "Album"
msgstr "Álbums"
#: models.py:39 models/album.py:15
msgid "Albums"
msgstr "Álbums"
#: models.py:45 models.py:99 models/bases/album.py:36 models/bases/image.py:44
#: templates/imagestore/image-scope.html:3 templates/imagestore/user.html:8
#: templates/imagestore/user.html.py:17 templates/imagestore/user_info.html:5
#: templates/imagestore/image_lists/image_list.html:15
msgid "User"
msgstr "Utilizador"
#: models.py:46 models/bases/album.py:37
msgid "Name"
msgstr "Nome"
#: models.py:47 models.py:100 models/bases/album.py:38
#: models/bases/image.py:45
msgid "Created"
msgstr "Criado"
#: models.py:48 models.py:101 models/bases/album.py:39
#: models/bases/image.py:46
msgid "Updated"
msgstr "Atualizado"
#: models.py:49 models/bases/album.py:40
msgid "Is public"
msgstr "É público"
#: models.py:52 models.py:97 models/bases/album.py:43 models/bases/image.py:42
msgid "Order"
msgstr "Ordem"
#: models.py:79 models/bases/album.py:70
#: templates/imagestore/album_list.html:50
msgid "Empty album"
msgstr "Album Vazio"
#: models.py:81 models/bases/album.py:72
msgid "Head"
msgstr "Cabeçalho"
#: models.py:87 models/image.py:13 templates/imagestore/image.html:7
msgid "Image"
msgstr "Imagem"
#: models.py:88 models/image.py:14
msgid "Images"
msgstr "Imagens"
#: models.py:94 models/bases/image.py:39
msgid "Title"
msgstr "Título"
#: models.py:96 models/bases/image.py:41 templates/imagestore/image.html:62
#: templates/imagestore/tag-cloud.html:6
msgid "Tags"
msgstr ""
#: models.py:98 models/bases/image.py:43
msgid "File"
msgstr "Ficheiro"
#: models.py:119 models/bases/image.py:64
msgid "Thumbnail"
msgstr "Miniatura"
#: models.py:123 templates/imagestore/image.html:70
msgid "Place"
msgstr "Lugar"
#: models.py:131 models/upload.py:26
msgid "images file (.zip)"
msgstr "Arquivo de imagens (.zip)"
#: models.py:132 models/upload.py:27
msgid "Select a .zip file of images to upload into a new Gallery."
msgstr ""
#: models.py:135 models/upload.py:32
msgid ""
"Select an album to add these images to. leave this empty to create a new "
"album from the supplied title."
msgstr ""
"Selecione um álbum para adicionar essas imagens. Deixe-o vazio para criar um "
"novo"
#: models.py:137 models/upload.py:37
msgid "New album name"
msgstr "Novo nome do Album"
#: models.py:138 models/upload.py:40
msgid "tags"
msgstr ""
#: models.py:141 models/upload.py:43
msgid "Album upload"
msgstr "Carregar Álbum"
#: models.py:142 models/upload.py:44
msgid "Album uploads"
msgstr "Carregar Álbums"
#: views.py:54
#, python-format
msgid "No Tag found matching \"%s\"."
msgstr "Tag não encontrada de acordo com \"%s\"."
#: imagestore_cms/cms_app.py:11
msgid "Imagestore App"
msgstr "Galleria"
#: imagestore_cms/cms_plugins.py:24
msgid "Album as carousel"
msgstr "Álbum como carrossel"
#: imagestore_cms/models.py:16
msgid "Skin"
msgstr "Tema"
#: imagestore_cms/models.py:17
msgid "Image limit"
msgstr "Limite de Imagens"
#: imagestore_cms/models.py:18
msgid "Thumbnail size"
msgstr "Tamanho da miniatura"
#: imagestore_cms/models.py:19
msgid "Full size view"
msgstr "Tamanho original"
#: models/upload.py:38
msgid ""
"If not empty new album with this name will be created and images will be "
"upload to this album"
msgstr ""
"Se não estiver vazio um novo álbum com este nome será criado e as imagens "
"serão carregadas automáticamente"
#: templates/imagestore/album_delete.html:6
msgid "Are you sure that you would like to delete this album?"
msgstr "Tem certeza que gostaria de excluir este álbum?"
#: templates/imagestore/album_delete.html:9
#: templates/imagestore/image_confirm_delete.html:8
#: templates/imagestore/image_delete.html:9
msgid "Yes"
msgstr "Sim"
#: templates/imagestore/album_delete.html:11
#: templates/imagestore/image_confirm_delete.html:10
#: templates/imagestore/image_delete.html:11
msgid "No"
msgstr "Não"
#: templates/imagestore/album_list.html:7
#: templates/imagestore/album_list.html:34
msgid "Albums for user"
msgstr "Albums por utilizador"
#: templates/imagestore/album_list.html:9
#: templates/imagestore/album_list.html:36
msgid "All albums"
msgstr "Todos os albums"
#: templates/imagestore/album_list.html:16
#: templates/imagestore/category.html:9 templates/imagestore/category.html:16
#: templates/imagestore/category.html:18 templates/imagestore/category.html:29
#: templates/imagestore/image-form.html:64 templates/imagestore/image.html:12
#: templates/imagestore/tag.html:7 templates/imagestore/tag.html.py:12
#: templates/imagestore/user.html:8 templates/imagestore/user.html.py:12
#: templates/imagestore/forms/album_form.html:13
#: templates/imagestore/forms/image_form.html:23
#: templates/imagestore/image_lists/image_list.html:7
msgid "Gallery"
msgstr "Galleria"
#: templates/imagestore/album_list.html:58
msgid "user"
msgstr "utilizador"
#: templates/imagestore/base.html:17 templates/imagestore/image-form.html:7
#: templates/imagestore/image-form.html:65
#: templates/imagestore/forms/image_form.html:7
#: templates/imagestore/forms/image_form.html:28
msgid "Upload image"
msgstr "Carregar Imagem"
#: templates/imagestore/base.html:20
msgid "Create new album"
msgstr "Criar novo álbum"
#: templates/imagestore/category.html:31
msgid "Categories"
msgstr "Categorias"
#: templates/imagestore/category.html:33
msgid "All images:"
msgstr "Todas as imagens"
#: templates/imagestore/image-form.html:71
#: templates/imagestore/forms/image_form.html:69
msgid "Upload"
msgstr "Carregar"
#: templates/imagestore/image-scope.html:9 templates/imagestore/tag.html:7
#: templates/imagestore/tag.html.py:13 templates/imagestore/tag.html:17
msgid "Tag"
msgstr ""
#: templates/imagestore/image.html:41
msgid "previous image"
msgstr "Imagem Anterior"
#: templates/imagestore/image.html:44
msgid "next image"
msgstr "Próxima imagem"
#: templates/imagestore/image.html:54
msgid "Edit info"
msgstr "Editar informação"
#: templates/imagestore/image.html:55
msgid "Delete image"
msgstr "Remover imagem"
#: templates/imagestore/image_confirm_delete.html:6
#: templates/imagestore/image_delete.html:6
msgid "Are you sure that you would like to delete this image?"
msgstr "Tem certeza que gostaria de apagar esta imagem?"
#: templates/imagestore/mini-pagination.html:5
#: templates/imagestore/pagination.html:5
msgid "previous"
msgstr "anterior"
#: templates/imagestore/mini-pagination.html:8
#: templates/imagestore/pagination.html:9
msgid "next"
msgstr "próxima"
#: templates/imagestore/pagination.html:7
msgid "of"
msgstr "de"
#: templates/imagestore/forms/album_form.html:7
#: templates/imagestore/forms/album_form.html:17
msgid "Create album"
msgstr "Criar álbum"
#: templates/imagestore/forms/album_form.html:21
msgid "Save"
msgstr "Guardar"
#: templates/imagestore/image_lists/image_list.html:21
msgid "Tag:"
msgstr ""
#: templates/imagestore/image_lists/image_list.html:43
msgid "Change album"
msgstr "Alterar álbum"

Binary file not shown.

View File

@ -0,0 +1,312 @@
# Copyright (C) 2010
# This file is distributed under the same license as the imagestore package.
# Pavel Zhukov <gelios@gmail.com> 2010
#
msgid ""
msgstr ""
"Project-Id-Version: IMAGESTORE \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2012-01-18 12:34+0400\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: Pavel Zhukov <gelios@gmail.com>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
#: forms.py:18 models.py:95 models/bases/image.py:40
msgid "Description"
msgstr "Описание"
#: models.py:38 models.py:102 imagestore_cms/cms_plugins.py:13
#: imagestore_cms/models.py:12 imagestore_cms/models.py:15 models/album.py:14
#: models/bases/image.py:47 templates/imagestore/image-scope.html:9
#: templates/imagestore/image.html:15
msgid "Album"
msgstr "Альбом"
#: models.py:39 models/album.py:15
msgid "Albums"
msgstr "Альбомы"
#: models.py:45 models.py:99 models/bases/album.py:36 models/bases/image.py:44
#: templates/imagestore/image-scope.html:4 templates/imagestore/image.html:12
#: templates/imagestore/user_info.html:5
msgid "User"
msgstr "Пользователь"
#: models.py:46 models/bases/album.py:37
msgid "Name"
msgstr "Имя"
#: models.py:47 models.py:100 models/bases/album.py:38
#: models/bases/image.py:45
msgid "Created"
msgstr "Создано"
#: models.py:48 models.py:101 models/bases/album.py:39
#: models/bases/image.py:46
msgid "Updated"
msgstr "Обновлено"
#: models.py:49 models/bases/album.py:40
msgid "Is public"
msgstr "Публичный"
#: models.py:52 models.py:97 models/bases/album.py:43 models/bases/image.py:42
msgid "Order"
msgstr "Порядок"
#: models.py:79 models/bases/album.py:70
#: templates/imagestore/album_list.html:53
msgid "Empty album"
msgstr "Пустой альбом"
#: models.py:81 models/bases/album.py:72
msgid "Head"
msgstr "Обложка"
#: models.py:87 models/image.py:13 templates/imagestore/image.html:7
msgid "Image"
msgstr "Изображение"
#: models.py:88 models/image.py:14
msgid "Images"
msgstr "Изображения"
#: models.py:94 models/bases/image.py:39
msgid "Title"
msgstr "Название"
#: models.py:96 models/bases/image.py:41 templates/imagestore/image.html:76
#: templates/imagestore/tag-cloud.html:6
msgid "Tags"
msgstr "Метки"
#: models.py:98 models/bases/image.py:43
msgid "File"
msgstr "Файл"
#: models.py:119 models/bases/image.py:64
msgid "Thumbnail"
msgstr "Эскиз"
#: models.py:123 templates/imagestore/image.html:84
msgid "Place"
msgstr "Место"
#: models.py:131 models/upload.py:26
msgid "images file (.zip)"
msgstr "файл с изображениями (.zip)"
#: models.py:132 models/upload.py:27
msgid "Select a .zip file of images to upload into a new Gallery."
msgstr "Выберите .zip файл с изображениями"
#: models.py:135 models/upload.py:32
msgid ""
"Select an album to add these images to. leave this empty to create a new "
"album from the supplied title."
msgstr "Выберите альбом, что-бы добавить эти изображения к нему. Оставьте это поле пустым, что-бы создать новый альбом"
#: models.py:137 models/upload.py:37
msgid "New album name"
msgstr "Название нового альбома"
#: models.py:138 models/upload.py:40
msgid "tags"
msgstr "метки"
#: models.py:141 models/upload.py:43
msgid "Album upload"
msgstr "Загрузка альбома"
#: models.py:142 models/upload.py:44
msgid "Album uploads"
msgstr "Загрузка альбомов"
#: views.py:55
#, python-format
msgid "No Tag found matching \"%s\"."
msgstr "Нет тэгов совпадающих с \"%s\"."
#: imagestore_cms/cms_app.py:11
msgid "Imagestore App"
msgstr "Imagestore приложение"
#: imagestore_cms/cms_plugins.py:24
msgid "Album as carousel"
msgstr "Альбомы как карусель"
#: imagestore_cms/models.py:16
msgid "Skin"
msgstr "Тема"
#: imagestore_cms/models.py:17
msgid "Image limit"
msgstr "Ограничить изображения"
#: imagestore_cms/models.py:18
msgid "Thumbnail size"
msgstr "Размер эскиза"
#: imagestore_cms/models.py:19
msgid "Full size view"
msgstr "Просмотреть полный размер"
#: imagestore_cms/models.py:20
msgid "Template file"
msgstr "Файл шаблона"
#: models/upload.py:38
msgid ""
"If not empty new album with this name will be created and images will be "
"upload to this album"
msgstr ""
#: templates/imagestore/album_delete.html:6
msgid "Are you sure that you would like to delete this album?"
msgstr "Вы уверенны, что хотите удалить это изображение"
#: templates/imagestore/album_delete.html:10
#: templates/imagestore/image_confirm_delete.html:10
#: templates/imagestore/image_delete.html:10
msgid "No, take me back"
msgstr "Нет, верните меня назад"
#: templates/imagestore/album_delete.html:11
#: templates/imagestore/image_confirm_delete.html:11
#: templates/imagestore/image_delete.html:11
msgid "Yes, I am sure"
msgstr "Да, я уверен"
#: templates/imagestore/album_list.html:7
#: templates/imagestore/album_list.html:16
#: templates/imagestore/album_list.html:37
msgid "Albums for user"
msgstr "Альбомы пользователя"
#: templates/imagestore/album_list.html:9
#: templates/imagestore/album_list.html:18
#: templates/imagestore/album_list.html:39
msgid "All albums"
msgstr "Все альбомы"
#: templates/imagestore/album_list.html:60
msgid "user"
msgstr "пользователь"
#: templates/imagestore/base.html:13
msgid "Home"
msgstr "Главная"
#: templates/imagestore/base.html:16 templates/imagestore/tag.html:7
msgid "Gallery"
msgstr "Галерея"
#: templates/imagestore/base.html:32
#: templates/imagestore/forms/image_form.html:7
#: templates/imagestore/forms/image_form.html:22
#: templates/imagestore/forms/image_form.html:26
msgid "Upload image"
msgstr "Загрузить изображение"
#: templates/imagestore/base.html:35
msgid "Create new album"
msgstr "Создать новый альбом"
#: templates/imagestore/image-scope.html:14 templates/imagestore/image.html:18
#: templates/imagestore/tag.html:7 templates/imagestore/tag.html.py:11
#: templates/imagestore/tag.html:15
msgid "Tag"
msgstr "Метка"
#: templates/imagestore/image.html:55
msgid "previous image"
msgstr "предыдущее изображение"
#: templates/imagestore/image.html:58
msgid "next image"
msgstr "следующее изображение"
#: templates/imagestore/image.html:68
msgid "Edit info"
msgstr "Редактировать информацию"
#: templates/imagestore/image.html:69
msgid "Delete image"
msgstr "Удалить изображение"
#: templates/imagestore/image_confirm_delete.html:6
#: templates/imagestore/image_delete.html:6
msgid "Are you sure that you would like to delete this image?"
msgstr "Вы уверенны, что хотите удалить это изображение"
#: templates/imagestore/image_list.html:33
#: templates/imagestore/forms/album_form.html:13
#: templates/imagestore/forms/album_form.html:23
msgid "Edit album"
msgstr "Редактировать альбом"
#: templates/imagestore/pagination.html:8
msgid "previous page"
msgstr "предыдущая страница"
#: templates/imagestore/pagination.html:22
msgid "next page"
msgstr "следующая страница"
#: templates/imagestore/forms/album_form.html:7
#: templates/imagestore/forms/album_form.html:15
#: templates/imagestore/forms/album_form.html:25
msgid "Create album"
msgstr "Создать альбом"
#: templates/imagestore/forms/album_form.html:31
msgid "Save"
msgstr "Сохранить"
#: templates/imagestore/forms/image_form.html:30
msgid "Upload"
msgstr "Загрузить"
#~ msgid "Yes"
#~ msgstr "Да"
#~ msgid "No"
#~ msgstr "Нет"
#~ msgid "Categories"
#~ msgstr "Категории"
#~ msgid "All images:"
#~ msgstr "Все изображения:"
#~ msgid "previous"
#~ msgstr "предыдущие"
#~ msgid "next"
#~ msgstr "следующие"
#~ msgid "of"
#~ msgstr "из"
#~ msgid "Tag:"
#~ msgstr "Метка"
#~ msgid "Change album"
#~ msgstr "Изменить альбом"
#~ msgid "Place doesn't found"
#~ msgstr "Место не найдено"
#~ msgid "Uploaded by"
#~ msgstr "Загружено"
#~ msgid "Category"
#~ msgstr "Категория"
#~ msgid "Slug"
#~ msgstr "Метка"
#~ msgid "Image was created successfully."
#~ msgstr "Изображение загружено успешно"

View File

@ -0,0 +1,78 @@
# encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'Category'
db.create_table('imagestore_category', (
('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
('parent', self.gf('django.db.models.fields.related.ForeignKey')(blank=True, related_name='children', null=True, to=orm['imagestore.Category'])),
('slug', self.gf('django.db.models.fields.SlugField')(max_length=200, db_index=True)),
('title', self.gf('django.db.models.fields.CharField')(max_length=200)),
('order', self.gf('django.db.models.fields.IntegerField')()),
('is_public', self.gf('django.db.models.fields.BooleanField')(default=False)),
('lft', self.gf('django.db.models.fields.PositiveIntegerField')(db_index=True)),
('rght', self.gf('django.db.models.fields.PositiveIntegerField')(db_index=True)),
('tree_id', self.gf('django.db.models.fields.PositiveIntegerField')(db_index=True)),
('level', self.gf('django.db.models.fields.PositiveIntegerField')(db_index=True)),
))
db.send_create_signal('imagestore', ['Category'])
# Adding model 'Image'
db.create_table('imagestore_image', (
('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
('slug', self.gf('django.db.models.fields.SlugField')(db_index=True, max_length=200, null=True, blank=True)),
('title', self.gf('django.db.models.fields.CharField')(max_length=200, null=True, blank=True)),
('description', self.gf('django.db.models.fields.TextField')(null=True, blank=True)),
('tags', self.gf('tagging.fields.TagField')()),
('category', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['imagestore.Category'])),
('order', self.gf('django.db.models.fields.IntegerField')(null=True, blank=True)),
('is_public', self.gf('django.db.models.fields.BooleanField')(default=True)),
('image', self.gf('sorl.thumbnail.fields.ImageField')(max_length=100)),
))
db.send_create_signal('imagestore', ['Image'])
def backwards(self, orm):
# Deleting model 'Category'
db.delete_table('imagestore_category')
# Deleting model 'Image'
db.delete_table('imagestore_image')
models = {
'imagestore.category': {
'Meta': {'object_name': 'Category'},
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'is_public': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'level': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}),
'lft': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}),
'order': ('django.db.models.fields.IntegerField', [], {}),
'parent': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'children'", 'null': 'True', 'to': "orm['imagestore.Category']"}),
'rght': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}),
'slug': ('django.db.models.fields.SlugField', [], {'max_length': '200', 'db_index': 'True'}),
'title': ('django.db.models.fields.CharField', [], {'max_length': '200'}),
'tree_id': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'})
},
'imagestore.image': {
'Meta': {'object_name': 'Image'},
'category': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['imagestore.Category']"}),
'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'image': ('sorl.thumbnail.fields.ImageField', [], {'max_length': '100'}),
'is_public': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
'order': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}),
'slug': ('django.db.models.fields.SlugField', [], {'db_index': 'True', 'max_length': '200', 'null': 'True', 'blank': 'True'}),
'tags': ('tagging.fields.TagField', [], {}),
'title': ('django.db.models.fields.CharField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'})
}
}
complete_apps = ['imagestore']

View File

@ -0,0 +1,48 @@
# encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Deleting field 'Image.slug'
db.delete_column('imagestore_image', 'slug')
def backwards(self, orm):
# Adding field 'Image.slug'
db.add_column('imagestore_image', 'slug', self.gf('django.db.models.fields.SlugField')(blank=True, max_length=200, null=True, db_index=True), keep_default=False)
models = {
'imagestore.category': {
'Meta': {'ordering': "('order', 'title')", 'object_name': 'Category'},
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'is_public': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'level': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}),
'lft': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}),
'order': ('django.db.models.fields.IntegerField', [], {}),
'parent': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'children'", 'null': 'True', 'to': "orm['imagestore.Category']"}),
'rght': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}),
'slug': ('django.db.models.fields.SlugField', [], {'max_length': '200', 'db_index': 'True'}),
'title': ('django.db.models.fields.CharField', [], {'max_length': '200'}),
'tree_id': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'})
},
'imagestore.image': {
'Meta': {'object_name': 'Image'},
'category': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'images'", 'to': "orm['imagestore.Category']"}),
'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'image': ('sorl.thumbnail.fields.ImageField', [], {'max_length': '100'}),
'is_public': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
'order': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}),
'tags': ('tagging.fields.TagField', [], {}),
'title': ('django.db.models.fields.CharField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'})
}
}
complete_apps = ['imagestore']

View File

@ -0,0 +1,85 @@
# encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'Image.user'
db.add_column('imagestore_image', 'user', self.gf('django.db.models.fields.related.ForeignKey')(blank=True, related_name='images', null=True, to=orm['auth.User']), keep_default=False)
def backwards(self, orm):
# Deleting field 'Image.user'
db.delete_column('imagestore_image', 'user_id')
models = {
'auth.group': {
'Meta': {'object_name': 'Group'},
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}),
'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'})
},
'auth.permission': {
'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'},
'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '50'})
},
'auth.user': {
'Meta': {'object_name': 'User'},
'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}),
'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}),
'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'})
},
'contenttypes.contenttype': {
'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"},
'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '100'})
},
'imagestore.category': {
'Meta': {'ordering': "('order', 'title')", 'object_name': 'Category'},
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'is_public': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'level': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}),
'lft': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}),
'order': ('django.db.models.fields.IntegerField', [], {}),
'parent': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'children'", 'null': 'True', 'to': "orm['imagestore.Category']"}),
'rght': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}),
'slug': ('django.db.models.fields.SlugField', [], {'max_length': '200', 'db_index': 'True'}),
'title': ('django.db.models.fields.CharField', [], {'max_length': '200'}),
'tree_id': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'})
},
'imagestore.image': {
'Meta': {'object_name': 'Image'},
'category': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'images'", 'to': "orm['imagestore.Category']"}),
'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'image': ('sorl.thumbnail.fields.ImageField', [], {'max_length': '100'}),
'is_public': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
'order': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}),
'tags': ('tagging.fields.TagField', [], {}),
'title': ('django.db.models.fields.CharField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}),
'user': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'images'", 'null': 'True', 'to': "orm['auth.User']"})
}
}
complete_apps = ['imagestore']

View File

@ -0,0 +1,85 @@
# encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Changing field 'Image.order'
db.alter_column('imagestore_image', 'order', self.gf('django.db.models.fields.IntegerField')())
def backwards(self, orm):
# Changing field 'Image.order'
db.alter_column('imagestore_image', 'order', self.gf('django.db.models.fields.IntegerField')(null=True))
models = {
'auth.group': {
'Meta': {'object_name': 'Group'},
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}),
'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'})
},
'auth.permission': {
'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'},
'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '50'})
},
'auth.user': {
'Meta': {'object_name': 'User'},
'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}),
'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}),
'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'})
},
'contenttypes.contenttype': {
'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"},
'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '100'})
},
'imagestore.category': {
'Meta': {'ordering': "('order', 'title')", 'object_name': 'Category'},
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'is_public': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'level': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}),
'lft': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}),
'order': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
'parent': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'children'", 'null': 'True', 'to': "orm['imagestore.Category']"}),
'rght': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}),
'slug': ('django.db.models.fields.SlugField', [], {'max_length': '200', 'db_index': 'True'}),
'title': ('django.db.models.fields.CharField', [], {'max_length': '200'}),
'tree_id': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'})
},
'imagestore.image': {
'Meta': {'ordering': "('order', 'id')", 'object_name': 'Image'},
'category': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'images'", 'to': "orm['imagestore.Category']"}),
'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'image': ('sorl.thumbnail.fields.ImageField', [], {'max_length': '100'}),
'is_public': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
'order': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
'tags': ('tagging.fields.TagField', [], {}),
'title': ('django.db.models.fields.CharField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}),
'user': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'images'", 'null': 'True', 'to': "orm['auth.User']"})
}
}
complete_apps = ['imagestore']

View File

@ -0,0 +1,98 @@
# encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'Album'
db.create_table('imagestore_album', (
('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
('name', self.gf('django.db.models.fields.CharField')(max_length=200)),
('created', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, blank=True)),
('updated', self.gf('django.db.models.fields.DateTimeField')(auto_now=True, blank=True)),
))
db.send_create_signal('imagestore', ['Album'])
def backwards(self, orm):
# Deleting model 'Album'
db.delete_table('imagestore_album')
models = {
'auth.group': {
'Meta': {'object_name': 'Group'},
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}),
'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'})
},
'auth.permission': {
'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'},
'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '50'})
},
'auth.user': {
'Meta': {'object_name': 'User'},
'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}),
'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}),
'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'})
},
'contenttypes.contenttype': {
'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"},
'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '100'})
},
'imagestore.album': {
'Meta': {'ordering': "('created', 'name')", 'object_name': 'Album'},
'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '200'}),
'updated': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'})
},
'imagestore.category': {
'Meta': {'ordering': "('order', 'title')", 'object_name': 'Category'},
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'is_public': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'level': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}),
'lft': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}),
'order': ('django.db.models.fields.IntegerField', [], {}),
'parent': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'children'", 'null': 'True', 'to': "orm['imagestore.Category']"}),
'rght': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}),
'slug': ('django.db.models.fields.SlugField', [], {'max_length': '200', 'db_index': 'True'}),
'title': ('django.db.models.fields.CharField', [], {'max_length': '200'}),
'tree_id': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'})
},
'imagestore.image': {
'Meta': {'ordering': "('order', 'id')", 'object_name': 'Image'},
'category': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'images'", 'to': "orm['imagestore.Category']"}),
'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'image': ('sorl.thumbnail.fields.ImageField', [], {'max_length': '100'}),
'is_public': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
'order': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
'tags': ('tagging.fields.TagField', [], {}),
'title': ('django.db.models.fields.CharField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}),
'user': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'images'", 'null': 'True', 'to': "orm['auth.User']"})
}
}
complete_apps = ['imagestore']

View File

@ -0,0 +1,106 @@
# encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'Image.created'
db.add_column('imagestore_image', 'created', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, null=True, blank=True), keep_default=False)
# Adding field 'Image.updated'
db.add_column('imagestore_image', 'updated', self.gf('django.db.models.fields.DateTimeField')(auto_now=True, null=True, blank=True), keep_default=False)
# Changing field 'Image.category'
db.alter_column('imagestore_image', 'category_id', self.gf('django.db.models.fields.related.ForeignKey')(null=True, to=orm['imagestore.Category']))
def backwards(self, orm):
# Deleting field 'Image.created'
db.delete_column('imagestore_image', 'created')
# Deleting field 'Image.updated'
db.delete_column('imagestore_image', 'updated')
# User chose to not deal with backwards NULL issues for 'Image.category'
raise RuntimeError("Cannot reverse this migration. 'Image.category' and its values cannot be restored.")
models = {
'auth.group': {
'Meta': {'object_name': 'Group'},
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}),
'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'})
},
'auth.permission': {
'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'},
'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '50'})
},
'auth.user': {
'Meta': {'object_name': 'User'},
'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}),
'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}),
'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'})
},
'contenttypes.contenttype': {
'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"},
'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '100'})
},
'imagestore.album': {
'Meta': {'ordering': "('created', 'name')", 'object_name': 'Album'},
'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '200'}),
'updated': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'})
},
'imagestore.category': {
'Meta': {'ordering': "('order', 'title')", 'object_name': 'Category'},
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'is_public': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'level': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}),
'lft': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}),
'order': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
'parent': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'children'", 'null': 'True', 'to': "orm['imagestore.Category']"}),
'rght': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}),
'slug': ('django.db.models.fields.SlugField', [], {'max_length': '200', 'db_index': 'True'}),
'title': ('django.db.models.fields.CharField', [], {'max_length': '200'}),
'tree_id': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'})
},
'imagestore.image': {
'Meta': {'ordering': "('order', 'id')", 'object_name': 'Image'},
'category': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'images'", 'null': 'True', 'to': "orm['imagestore.Category']"}),
'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'null': 'True', 'blank': 'True'}),
'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'image': ('sorl.thumbnail.fields.ImageField', [], {'max_length': '100'}),
'is_public': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
'order': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
'tags': ('tagging.fields.TagField', [], {}),
'title': ('django.db.models.fields.CharField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}),
'updated': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'null': 'True', 'blank': 'True'}),
'user': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'images'", 'null': 'True', 'to': "orm['auth.User']"})
}
}
complete_apps = ['imagestore']

View File

@ -0,0 +1,131 @@
# encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Deleting model 'Category'
db.delete_table('imagestore_category')
# Adding field 'Album.user'
db.add_column('imagestore_album', 'user', self.gf('django.db.models.fields.related.ForeignKey')(blank=True, related_name='albums', null=True, to=orm['auth.User']), keep_default=False)
# Adding field 'Album.is_public'
db.add_column('imagestore_album', 'is_public', self.gf('django.db.models.fields.BooleanField')(default=False), keep_default=False)
# Adding field 'Album.head'
db.add_column('imagestore_album', 'head', self.gf('django.db.models.fields.related.ForeignKey')(blank=True, related_name='head_of', null=True, to=orm['imagestore.Image']), keep_default=False)
# Deleting field 'Image.is_public'
db.delete_column('imagestore_image', 'is_public')
# Deleting field 'Image.category'
db.delete_column('imagestore_image', 'category_id')
# Adding field 'Image.album'
db.add_column('imagestore_image', 'album', self.gf('django.db.models.fields.related.ForeignKey')(blank=True, related_name='images', null=True, to=orm['imagestore.Album']), keep_default=False)
def backwards(self, orm):
# Adding model 'Category'
db.create_table('imagestore_category', (
('rght', self.gf('django.db.models.fields.PositiveIntegerField')(db_index=True)),
('parent', self.gf('django.db.models.fields.related.ForeignKey')(related_name='children', null=True, to=orm['imagestore.Category'], blank=True)),
('lft', self.gf('django.db.models.fields.PositiveIntegerField')(db_index=True)),
('is_public', self.gf('django.db.models.fields.BooleanField')(default=False)),
('slug', self.gf('django.db.models.fields.SlugField')(max_length=200, db_index=True)),
('level', self.gf('django.db.models.fields.PositiveIntegerField')(db_index=True)),
('title', self.gf('django.db.models.fields.CharField')(max_length=200)),
('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
('tree_id', self.gf('django.db.models.fields.PositiveIntegerField')(db_index=True)),
('order', self.gf('django.db.models.fields.IntegerField')(default=0)),
))
db.send_create_signal('imagestore', ['Category'])
# Deleting field 'Album.user'
db.delete_column('imagestore_album', 'user_id')
# Deleting field 'Album.is_public'
db.delete_column('imagestore_album', 'is_public')
# Deleting field 'Album.head'
db.delete_column('imagestore_album', 'head_id')
# Adding field 'Image.is_public'
db.add_column('imagestore_image', 'is_public', self.gf('django.db.models.fields.BooleanField')(default=True), keep_default=False)
# Adding field 'Image.category'
db.add_column('imagestore_image', 'category', self.gf('django.db.models.fields.related.ForeignKey')(related_name='images', null=True, to=orm['imagestore.Category'], blank=True), keep_default=False)
# Deleting field 'Image.album'
db.delete_column('imagestore_image', 'album_id')
models = {
'auth.group': {
'Meta': {'object_name': 'Group'},
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}),
'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'})
},
'auth.permission': {
'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'},
'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '50'})
},
'auth.user': {
'Meta': {'object_name': 'User'},
'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}),
'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}),
'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'})
},
'contenttypes.contenttype': {
'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"},
'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '100'})
},
'imagestore.album': {
'Meta': {'ordering': "('created', 'name')", 'object_name': 'Album'},
'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
'head': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'head_of'", 'null': 'True', 'to': "orm['imagestore.Image']"}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'is_public': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '200'}),
'updated': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
'user': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'albums'", 'null': 'True', 'to': "orm['auth.User']"})
},
'imagestore.image': {
'Meta': {'ordering': "('order', 'id')", 'object_name': 'Image'},
'album': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'images'", 'null': 'True', 'to': "orm['imagestore.Album']"}),
'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'null': 'True', 'blank': 'True'}),
'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'image': ('sorl.thumbnail.fields.ImageField', [], {'max_length': '100'}),
'order': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
'tags': ('tagging.fields.TagField', [], {}),
'title': ('django.db.models.fields.CharField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}),
'updated': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'null': 'True', 'blank': 'True'}),
'user': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'images'", 'null': 'True', 'to': "orm['auth.User']"})
}
}
complete_apps = ['imagestore']

View File

@ -0,0 +1,93 @@
# encoding: utf-8
import datetime
from south.db import db
from south.v2 import DataMigration
from django.db import models
from django.contrib.auth.management import create_permissions
from django.contrib.auth.models import User, Permission
from django.db.models import get_app
class Migration(DataMigration):
def forwards(self, orm):
app = get_app('imagestore')
create_permissions(app, (), 2)
add_image_permission = Permission.objects.get_by_natural_key('add_image', 'imagestore', 'image')
add_album_permission = Permission.objects.get_by_natural_key('add_album', 'imagestore', 'album')
change_image_permission = Permission.objects.get_by_natural_key('change_image', 'imagestore', 'image')
change_album_permission = Permission.objects.get_by_natural_key('change_album', 'imagestore', 'album')
delete_image_permission = Permission.objects.get_by_natural_key('delete_image', 'imagestore','image')
delete_album_permission = Permission.objects.get_by_natural_key('delete_album', 'imagestore', 'album')
for user in User.objects.all():
user.user_permissions.add(add_image_permission, add_album_permission,)
user.user_permissions.add(change_image_permission, change_album_permission,)
user.user_permissions.add(delete_image_permission, delete_album_permission,)
user.save()
def backwards(self, orm):
"Write your backwards methods here."
models = {
'auth.group': {
'Meta': {'object_name': 'Group'},
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}),
'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'})
},
'auth.permission': {
'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'},
'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '50'})
},
'auth.user': {
'Meta': {'object_name': 'User'},
'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}),
'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}),
'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'})
},
'contenttypes.contenttype': {
'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"},
'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '100'})
},
'imagestore.album': {
'Meta': {'ordering': "('created', 'name')", 'object_name': 'Album'},
'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
'head': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'head_of'", 'null': 'True', 'to': "orm['imagestore.Image']"}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'is_public': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '200'}),
'updated': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
'user': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'albums'", 'null': 'True', 'to': "orm['auth.User']"})
},
'imagestore.image': {
'Meta': {'ordering': "('order', 'id')", 'object_name': 'Image'},
'album': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'images'", 'null': 'True', 'to': "orm['imagestore.Album']"}),
'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'null': 'True', 'blank': 'True'}),
'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'image': ('sorl.thumbnail.fields.ImageField', [], {'max_length': '100'}),
'order': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
'tags': ('tagging.fields.TagField', [], {}),
'title': ('django.db.models.fields.CharField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}),
'updated': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'null': 'True', 'blank': 'True'}),
'user': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'images'", 'null': 'True', 'to': "orm['auth.User']"})
}
}
complete_apps = ['imagestore']

View File

@ -0,0 +1,89 @@
# encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Changing field 'Album.name'
db.alter_column('imagestore_album', 'name', self.gf('django.db.models.fields.CharField')(max_length=20))
# Changing field 'Image.title'
db.alter_column('imagestore_image', 'title', self.gf('django.db.models.fields.CharField')(max_length=20, null=True))
def backwards(self, orm):
# Changing field 'Album.name'
db.alter_column('imagestore_album', 'name', self.gf('django.db.models.fields.CharField')(max_length=200))
# Changing field 'Image.title'
db.alter_column('imagestore_image', 'title', self.gf('django.db.models.fields.CharField')(max_length=200, null=True))
models = {
'auth.group': {
'Meta': {'object_name': 'Group'},
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}),
'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'})
},
'auth.permission': {
'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'},
'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '50'})
},
'auth.user': {
'Meta': {'object_name': 'User'},
'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}),
'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}),
'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'})
},
'contenttypes.contenttype': {
'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"},
'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '100'})
},
'imagestore.album': {
'Meta': {'ordering': "('created', 'name')", 'object_name': 'Album'},
'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
'head': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'head_of'", 'null': 'True', 'to': "orm['imagestore.Image']"}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'is_public': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '20'}),
'updated': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
'user': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'albums'", 'null': 'True', 'to': "orm['auth.User']"})
},
'imagestore.image': {
'Meta': {'ordering': "('order', 'id')", 'object_name': 'Image'},
'album': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'images'", 'null': 'True', 'to': "orm['imagestore.Album']"}),
'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'null': 'True', 'blank': 'True'}),
'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'image': ('sorl.thumbnail.fields.ImageField', [], {'max_length': '100'}),
'order': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
'tags': ('tagging.fields.TagField', [], {}),
'title': ('django.db.models.fields.CharField', [], {'max_length': '20', 'null': 'True', 'blank': 'True'}),
'updated': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'null': 'True', 'blank': 'True'}),
'user': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'images'", 'null': 'True', 'to': "orm['auth.User']"})
}
}
complete_apps = ['imagestore']

View File

@ -0,0 +1,172 @@
# encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
try:
from places.models import GeoPlace
except:
GeoPlace = None
class Migration(SchemaMigration):
def forwards(self, orm):
if GeoPlace:
# Adding field 'Image.place'
db.add_column('imagestore_image', 'place', self.gf('django.db.models.fields.related.ForeignKey')(blank=True, related_name='images', null=True, to=orm['places.GeoPlace']), keep_default=False)
def backwards(self, orm):
# Deleting field 'Image.place'
db.delete_column('imagestore_image', 'place_id')
models = {
'auth.group': {
'Meta': {'object_name': 'Group'},
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}),
'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'})
},
'auth.permission': {
'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'},
'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '50'})
},
'auth.user': {
'Meta': {'object_name': 'User'},
'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}),
'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}),
'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'})
},
'contenttypes.contenttype': {
'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"},
'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '100'})
},
'imagestore.album': {
'Meta': {'ordering': "('created', 'name')", 'object_name': 'Album'},
'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
'head': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'head_of'", 'null': 'True', 'to': "orm['imagestore.Image']"}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'is_public': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '20'}),
'updated': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
'user': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'albums'", 'null': 'True', 'to': "orm['auth.User']"})
},
'imagestore.image': {
'Meta': {'ordering': "('order', 'id')", 'object_name': 'Image'},
'album': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'images'", 'null': 'True', 'to': "orm['imagestore.Album']"}),
'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'null': 'True', 'blank': 'True'}),
'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'image': ('sorl.thumbnail.fields.ImageField', [], {'max_length': '100'}),
'order': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
'place': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'images'", 'null': 'True', 'to': "orm['places.GeoPlace']"}),
'tags': ('tagging.fields.TagField', [], {}),
'title': ('django.db.models.fields.CharField', [], {'max_length': '20', 'null': 'True', 'blank': 'True'}),
'updated': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'null': 'True', 'blank': 'True'}),
'user': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'images'", 'null': 'True', 'to': "orm['auth.User']"})
},
'places.geoplace': {
'Meta': {'object_name': 'GeoPlace'},
'addional_info': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),
'address': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}),
'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'imagestore_tag': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}),
'latitude': ('django.db.models.fields.FloatField', [], {'null': 'True', 'blank': 'True'}),
'longtitude': ('django.db.models.fields.FloatField', [], {'null': 'True', 'blank': 'True'}),
'metro': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}),
'minuses': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
'near_objects': ('django.db.models.fields.related.ManyToManyField', [], {'blank': 'True', 'related_name': "'near_objects_rel_+'", 'null': 'True', 'to': "orm['places.GeoPlace']"}),
'near_text': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),
'path_to': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),
'phone': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}),
'pluses': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),
'tags': ('tagging.fields.TagField', [], {}),
'topic': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['pybb.Topic']", 'null': 'True', 'blank': 'True'}),
'type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['places.PlaceType']", 'null': 'None', 'blank': 'None'}),
'work_time': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'})
},
'places.placetype': {
'Meta': {'object_name': 'PlaceType'},
'forum': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['pybb.Forum']", 'null': 'True', 'blank': 'True'}),
'forum_user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'blank': 'True'}),
'icon_style': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
'name_plural': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
'path_to_image': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}),
'slug': ('django.db.models.fields.SlugField', [], {'max_length': '50', 'db_index': 'True'})
},
'pybb.category': {
'Meta': {'ordering': "['position']", 'object_name': 'Category'},
'hidden': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '80'}),
'position': ('django.db.models.fields.IntegerField', [], {'default': '0', 'blank': 'True'})
},
'pybb.forum': {
'Meta': {'ordering': "['position']", 'object_name': 'Forum'},
'category': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'forums'", 'to': "orm['pybb.Category']"}),
'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
'headline': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),
'hidden': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'moderators': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'to': "orm['auth.User']", 'null': 'True', 'blank': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '80'}),
'position': ('django.db.models.fields.IntegerField', [], {'default': '0', 'blank': 'True'}),
'post_count': ('django.db.models.fields.IntegerField', [], {'default': '0', 'blank': 'True'}),
'readed_by': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'readed_forums'", 'symmetrical': 'False', 'through': "orm['pybb.ForumReadTracker']", 'to': "orm['auth.User']"}),
'topic_count': ('django.db.models.fields.IntegerField', [], {'default': '0', 'blank': 'True'}),
'updated': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'})
},
'pybb.forumreadtracker': {
'Meta': {'object_name': 'ForumReadTracker'},
'forum': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['pybb.Forum']", 'null': 'True', 'blank': 'True'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'time_stamp': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"})
},
'pybb.topic': {
'Meta': {'ordering': "['-created']", 'object_name': 'Topic'},
'closed': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'created': ('django.db.models.fields.DateTimeField', [], {'null': 'True'}),
'forum': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'topics'", 'to': "orm['pybb.Forum']"}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
'post_count': ('django.db.models.fields.IntegerField', [], {'default': '0', 'blank': 'True'}),
'readed_by': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'readed_topics'", 'symmetrical': 'False', 'through': "orm['pybb.TopicReadTracker']", 'to': "orm['auth.User']"}),
'sticky': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'subscribers': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'related_name': "'subscriptions'", 'blank': 'True', 'to': "orm['auth.User']"}),
'updated': ('django.db.models.fields.DateTimeField', [], {'null': 'True'}),
'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}),
'views': ('django.db.models.fields.IntegerField', [], {'default': '0', 'blank': 'True'})
},
'pybb.topicreadtracker': {
'Meta': {'object_name': 'TopicReadTracker'},
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'time_stamp': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
'topic': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['pybb.Topic']", 'null': 'True', 'blank': 'True'}),
'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"})
}
}
complete_apps = ['imagestore']

View File

@ -0,0 +1,98 @@
# encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'AlbumUpload'
db.create_table('imagestore_albumupload', (
('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
('zip_file', self.gf('django.db.models.fields.files.FileField')(max_length=100)),
('album', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['imagestore.Album'], null=True, blank=True)),
('new_album_name', self.gf('django.db.models.fields.CharField')(max_length=255, blank=True)),
('tags', self.gf('django.db.models.fields.CharField')(max_length=255, blank=True)),
))
db.send_create_signal('imagestore', ['AlbumUpload'])
def backwards(self, orm):
# Deleting model 'AlbumUpload'
db.delete_table('imagestore_albumupload')
models = {
'auth.group': {
'Meta': {'object_name': 'Group'},
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}),
'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'})
},
'auth.permission': {
'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'},
'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '50'})
},
'auth.user': {
'Meta': {'object_name': 'User'},
'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}),
'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}),
'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'})
},
'contenttypes.contenttype': {
'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"},
'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '100'})
},
'imagestore.album': {
'Meta': {'ordering': "('created', 'name')", 'object_name': 'Album'},
'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
'head': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'head_of'", 'null': 'True', 'to': "orm['imagestore.Image']"}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'is_public': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '20'}),
'updated': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
'user': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'albums'", 'null': 'True', 'to': "orm['auth.User']"})
},
'imagestore.albumupload': {
'Meta': {'object_name': 'AlbumUpload'},
'album': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['imagestore.Album']", 'null': 'True', 'blank': 'True'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'new_album_name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}),
'tags': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}),
'zip_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100'})
},
'imagestore.image': {
'Meta': {'ordering': "('order', 'id')", 'object_name': 'Image'},
'album': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'images'", 'null': 'True', 'to': "orm['imagestore.Album']"}),
'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'null': 'True', 'blank': 'True'}),
'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'image': ('sorl.thumbnail.fields.ImageField', [], {'max_length': '100'}),
'order': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
'tags': ('tagging.fields.TagField', [], {}),
'title': ('django.db.models.fields.CharField', [], {'max_length': '20', 'null': 'True', 'blank': 'True'}),
'updated': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'null': 'True', 'blank': 'True'}),
'user': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'images'", 'null': 'True', 'to': "orm['auth.User']"})
}
}
complete_apps = ['imagestore']

View File

@ -0,0 +1,92 @@
# encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'Album.order'
db.add_column('imagestore_album', 'order', self.gf('django.db.models.fields.IntegerField')(default=0), keep_default=False)
def backwards(self, orm):
# Deleting field 'Album.order'
db.delete_column('imagestore_album', 'order')
models = {
'auth.group': {
'Meta': {'object_name': 'Group'},
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}),
'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'})
},
'auth.permission': {
'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'},
'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '50'})
},
'auth.user': {
'Meta': {'object_name': 'User'},
'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}),
'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}),
'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'})
},
'contenttypes.contenttype': {
'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"},
'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '100'})
},
'imagestore.album': {
'Meta': {'ordering': "('created', 'name')", 'object_name': 'Album'},
'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
'head': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'head_of'", 'null': 'True', 'to': "orm['imagestore.Image']"}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'is_public': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '20'}),
'order': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
'updated': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
'user': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'albums'", 'null': 'True', 'to': "orm['auth.User']"})
},
'imagestore.albumupload': {
'Meta': {'object_name': 'AlbumUpload'},
'album': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['imagestore.Album']", 'null': 'True', 'blank': 'True'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'new_album_name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}),
'tags': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}),
'zip_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100'})
},
'imagestore.image': {
'Meta': {'ordering': "('order', 'id')", 'object_name': 'Image'},
'album': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'images'", 'null': 'True', 'to': "orm['imagestore.Album']"}),
'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'null': 'True', 'blank': 'True'}),
'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'image': ('sorl.thumbnail.fields.ImageField', [], {'max_length': '100'}),
'order': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
'tags': ('tagging.fields.TagField', [], {}),
'title': ('django.db.models.fields.CharField', [], {'max_length': '20', 'null': 'True', 'blank': 'True'}),
'updated': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'null': 'True', 'blank': 'True'}),
'user': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'images'", 'null': 'True', 'to': "orm['auth.User']"})
}
}
complete_apps = ['imagestore']

View File

@ -0,0 +1,92 @@
# encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Changing field 'Image.title'
db.alter_column('imagestore_image', 'title', self.gf('django.db.models.fields.CharField')(max_length=100, null=True))
def backwards(self, orm):
# Changing field 'Image.title'
db.alter_column('imagestore_image', 'title', self.gf('django.db.models.fields.CharField')(max_length=20, null=True))
models = {
'auth.group': {
'Meta': {'object_name': 'Group'},
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}),
'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'})
},
'auth.permission': {
'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'},
'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '50'})
},
'auth.user': {
'Meta': {'object_name': 'User'},
'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}),
'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}),
'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'})
},
'contenttypes.contenttype': {
'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"},
'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '100'})
},
'imagestore.album': {
'Meta': {'ordering': "('created', 'name')", 'object_name': 'Album'},
'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
'head': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'head_of'", 'null': 'True', 'to': "orm['imagestore.Image']"}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'is_public': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '20'}),
'order': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
'updated': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
'user': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'albums'", 'null': 'True', 'to': "orm['auth.User']"})
},
'imagestore.albumupload': {
'Meta': {'object_name': 'AlbumUpload'},
'album': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['imagestore.Album']", 'null': 'True', 'blank': 'True'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'new_album_name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}),
'tags': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}),
'zip_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100'})
},
'imagestore.image': {
'Meta': {'ordering': "('order', 'id')", 'object_name': 'Image'},
'album': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'images'", 'null': 'True', 'to': "orm['imagestore.Album']"}),
'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'null': 'True', 'blank': 'True'}),
'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'image': ('sorl.thumbnail.fields.ImageField', [], {'max_length': '100'}),
'order': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
'tags': ('tagging.fields.TagField', [], {}),
'title': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}),
'updated': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'null': 'True', 'blank': 'True'}),
'user': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'images'", 'null': 'True', 'to': "orm['auth.User']"})
}
}
complete_apps = ['imagestore']

View File

@ -0,0 +1,92 @@
# encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Changing field 'Album.name'
db.alter_column('imagestore_album', 'name', self.gf('django.db.models.fields.CharField')(max_length=100))
def backwards(self, orm):
# Changing field 'Album.name'
db.alter_column('imagestore_album', 'name', self.gf('django.db.models.fields.CharField')(max_length=20))
models = {
'auth.group': {
'Meta': {'object_name': 'Group'},
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}),
'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'})
},
'auth.permission': {
'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'},
'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '50'})
},
'auth.user': {
'Meta': {'object_name': 'User'},
'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}),
'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}),
'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'})
},
'contenttypes.contenttype': {
'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"},
'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '100'})
},
'imagestore.album': {
'Meta': {'ordering': "('created', 'name')", 'object_name': 'Album'},
'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
'head': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'head_of'", 'null': 'True', 'to': "orm['imagestore.Image']"}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'is_public': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
'order': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
'updated': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
'user': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'albums'", 'null': 'True', 'to': "orm['auth.User']"})
},
'imagestore.albumupload': {
'Meta': {'object_name': 'AlbumUpload'},
'album': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['imagestore.Album']", 'null': 'True', 'blank': 'True'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'new_album_name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}),
'tags': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}),
'zip_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100'})
},
'imagestore.image': {
'Meta': {'ordering': "('order', 'id')", 'object_name': 'Image'},
'album': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'images'", 'null': 'True', 'to': "orm['imagestore.Album']"}),
'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'null': 'True', 'blank': 'True'}),
'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'image': ('sorl.thumbnail.fields.ImageField', [], {'max_length': '100'}),
'order': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
'tags': ('tagging.fields.TagField', [], {}),
'title': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}),
'updated': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'null': 'True', 'blank': 'True'}),
'user': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'images'", 'null': 'True', 'to': "orm['auth.User']"})
}
}
complete_apps = ['imagestore']

View File

@ -0,0 +1,5 @@
#!/usr/bin/env python
# vim:fileencoding=utf-8
__author__ = 'zeus'

View File

@ -0,0 +1,19 @@
#!/usr/bin/env python
# vim:fileencoding=utf-8
__author__ = 'zeus'
from imagestore.utils import load_class, get_model_string
from django.conf import settings
Album = load_class(getattr(settings, 'IMAGESTORE_ALBUM_MODEL', 'imagestore.models.album.Album'))
Image = load_class(getattr(settings, 'IMAGESTORE_IMAGE_MODEL', 'imagestore.models.image.Image'))
# This labels and classnames used to generate permissons labels
image_applabel = Image._meta.app_label
image_classname = Image.__name__.lower()
album_applabel = Album._meta.app_label
album_classname = Album.__name__.lower()
from upload import AlbumUpload

View File

@ -0,0 +1,21 @@
#!/usr/bin/env python
# vim:fileencoding=utf-8
__author__ = 'zeus'
from bases.album import BaseAlbum
from django.utils.translation import ugettext_lazy as _
from imagestore.utils import load_class, get_model_string
from django.db import models
from django.contrib.contenttypes import generic
from django.contrib.contenttypes.models import ContentType
class Album(BaseAlbum):
content_type = models.ForeignKey(ContentType)
object_id = models.PositiveIntegerField()
content_object = generic.GenericForeignKey('content_type', 'object_id')
class Meta(BaseAlbum.Meta):
abstract = False
verbose_name = _('Album')
verbose_name_plural = _('Albums')
app_label = 'imagestore'

View File

@ -0,0 +1,5 @@
#!/usr/bin/env python
# vim:fileencoding=utf-8
__author__ = 'zeus'

View File

@ -0,0 +1,73 @@
#!/usr/bin/env python
# vim:fileencoding=utf-8
__author__ = 'zeus'
from django.db import models
from django.db.models import permalink
from sorl.thumbnail.helpers import ThumbnailError
from tagging.fields import TagField
from django.utils.translation import ugettext_lazy as _
from django.conf import settings
from sorl.thumbnail import ImageField, get_thumbnail
from django.contrib.auth.models import User, Permission
from django.db.models.signals import post_save
try:
import Image as PILImage
except ImportError:
from PIL import Image as PILImage
from imagestore.utils import get_file_path, get_model_string
SELF_MANAGE = getattr(settings, 'IMAGESTORE_SELF_MANAGE', True)
class BaseAlbum(models.Model):
class Meta(object):
abstract = True
ordering = ('order', 'created', 'name')
permissions = (
('moderate_albums', 'View, update and delete any album'),
)
user = models.ForeignKey(User, verbose_name=_('User'), null=True, blank=True, related_name='albums')
name = models.CharField(_('Name'), max_length=100, blank=False, null=False)
created = models.DateTimeField(_('Created'), auto_now_add=True)
updated = models.DateTimeField(_('Updated'), auto_now=True)
is_public = models.BooleanField(_('Is public'), default=True)
head = models.ForeignKey(get_model_string('Image'), related_name='head_of', null=True, blank=True)
order = models.IntegerField(_('Order'), default=0)
def get_head(self):
if self.head:
return self.head
else:
if self.images.all().count()>0:
self.head = self.images.all()[0]
self.save()
return self.head
else:
return None
@permalink
def get_absolute_url(self):
return 'imagestore:album', (), {'album_id': self.id}
def __unicode__(self):
return self.name
def admin_thumbnail(self):
img = self.get_head()
if img:
try:
return '<img src="%s">' % get_thumbnail(img.image, '100x100', crop='center').url
except IOError:
return 'IOError'
return _('Empty album')
admin_thumbnail.short_description = _('Head')
admin_thumbnail.allow_tags = True

View File

@ -0,0 +1,100 @@
#!/usr/bin/env python
# vim:fileencoding=utf-8
__author__ = 'zeus'
from django.db import models
from django.db.models import permalink
from sorl.thumbnail.helpers import ThumbnailError
from tagging.fields import TagField
from django.utils.translation import ugettext_lazy as _
from django.conf import settings
from sorl.thumbnail import ImageField, get_thumbnail
from django.contrib.auth.models import User, Permission
from django.db.models.signals import post_save
from django.contrib.contenttypes.models import ContentType
from django.core.exceptions import ObjectDoesNotExist
try:
import Image as PILImage
except ImportError:
from PIL import Image as PILImage
from imagestore.utils import get_file_path, get_model_string, load_class
SELF_MANAGE = getattr(settings, 'IMAGESTORE_SELF_MANAGE', True)
class BaseImage(models.Model):
class Meta(object):
abstract = True
ordering = ('order', 'id')
permissions = (
('moderate_images', 'View, update and delete any image'),
)
title = models.CharField(_('Title'), max_length=100, blank=True, null=True)
description = models.TextField(_('Description'), blank=True, null=True)
tags = TagField(_('Tags'), blank=True)
order = models.IntegerField(_('Order'), default=0)
image = ImageField(verbose_name = _('File'), upload_to=get_file_path)
user = models.ForeignKey(User, verbose_name=_('User'), null=True, blank=True, related_name='images')
created = models.DateTimeField(_('Created'), auto_now_add=True, null=True)
updated = models.DateTimeField(_('Updated'), auto_now=True, null=True)
album = models.ForeignKey(get_model_string('Album'), verbose_name=_('Album'), null=True, blank=True, related_name='images')
@permalink
def get_absolute_url(self):
return 'imagestore:image', (), {'pk': self.id}
def __unicode__(self):
return '%s'% self.id
def admin_thumbnail(self):
try:
return '<img src="%s">' % get_thumbnail(self.image, '100x100', crop='center').url
except IOError:
return 'IOError'
except ThumbnailError, ex:
return 'ThumbnailError, %s' % ex.message
admin_thumbnail.short_description = _('Thumbnail')
admin_thumbnail.allow_tags = True
#noinspection PyUnusedLocal
def setup_imagestore_permissions(instance, created, **kwargs):
if not created:
return
try:
from imagestore.models import Album, Image
album_type = ContentType.objects.get(
#app_label=load_class('imagestore.models.Album')._meta.app_label,
app_label = Album._meta.app_label,
name='Album'
)
image_type = ContentType.objects.get(
#app_label=load_class('imagestore.models.Image')._meta.app_label,
app_label = Image._meta.app_label,
name='Image'
)
add_image_permission = Permission.objects.get(codename='add_image', content_type=image_type)
add_album_permission = Permission.objects.get(codename='add_album', content_type=album_type)
change_image_permission = Permission.objects.get(codename='change_image', content_type=image_type)
change_album_permission = Permission.objects.get(codename='change_album', content_type=album_type)
delete_image_permission = Permission.objects.get(codename='delete_image', content_type=image_type)
delete_album_permission = Permission.objects.get(codename='delete_album', content_type=album_type)
instance.user_permissions.add(add_image_permission, add_album_permission,)
instance.user_permissions.add(change_image_permission, change_album_permission,)
instance.user_permissions.add(delete_image_permission, delete_album_permission,)
except ObjectDoesNotExist:
# Permissions are not yet installed or conten does not created yet
# probaly this is first
pass
if SELF_MANAGE:
post_save.connect(setup_imagestore_permissions, User)

View File

@ -0,0 +1,15 @@
#!/usr/bin/env python
# vim:fileencoding=utf-8
__author__ = 'zeus'
from bases.image import BaseImage
from django.utils.translation import ugettext_lazy as _
from imagestore.utils import load_class, get_model_string
class Image(BaseImage):
class Meta(BaseImage.Meta):
abstract = False
verbose_name = _('Image')
verbose_name_plural = _('Images')
app_label = 'imagestore'

View File

@ -0,0 +1,87 @@
#!/usr/bin/env python
# vim:fileencoding=utf-8
__author__ = 'zeus'
import os
import zipfile
from django.db import models
from imagestore.utils import load_class, get_model_string
from django.utils.translation import ugettext_lazy as _
from django.conf import settings
from django.core.files.base import ContentFile
try:
import Image as PILImage
except ImportError:
from PIL import Image as PILImage
from imagestore.models import Album, Image
TEMP_DIR = getattr(settings, 'TEMP_DIR', 'temp/')
class AlbumUpload(models.Model):
"""
Just re-written django-photologue GalleryUpload method
"""
zip_file = models.FileField(_('images file (.zip)'), upload_to=TEMP_DIR,
help_text=_('Select a .zip file of images to upload into a new Gallery.'))
album = models.ForeignKey(
Album,
null=True,
blank=True,
help_text=_('Select an album to add these images to. leave this empty to create a new album from the supplied title.')
)
new_album_name = models.CharField(
max_length=255,
blank=True,
verbose_name=_('New album name'),
help_text=_('If not empty new album with this name will be created and images will be upload to this album')
)
tags = models.CharField(max_length=255, blank=True, verbose_name=_('tags'))
class Meta(object):
verbose_name = _('Album upload')
verbose_name_plural = _('Album uploads')
app_label = 'imagestore'
def save(self, *args, **kwargs):
super(AlbumUpload, self).save(*args, **kwargs)
album = self.process_zipfile()
super(AlbumUpload, self).delete()
return album
def process_zipfile(self):
if os.path.isfile(self.zip_file.path):
# TODO: implement try-except here
zip = zipfile.ZipFile(self.zip_file.path)
bad_file = zip.testzip()
if bad_file:
raise Exception('"%s" in the .zip archive is corrupt.' % bad_file)
count = 1
album = self.album
if not album:
album = Album.objects.create(name=self.new_album_name)
from cStringIO import StringIO
for filename in sorted(zip.namelist()):
if filename.startswith('__'): # do not process meta files
continue
data = zip.read(filename)
if len(data):
try:
# the following is taken from django.newforms.fields.ImageField:
# load() is the only method that can spot a truncated JPEG,
# but it cannot be called sanely after verify()
trial_image = PILImage.open(StringIO(data))
trial_image.load()
# verify() is the only method that can spot a corrupt PNG,
# but it must be called immediately after the constructor
trial_image = PILImage.open(StringIO(data))
trial_image.verify()
except Exception:
# if a "bad" file is found we just skip it.
continue
img = Image(album=album)
img.image.save(filename, ContentFile(data))
img.save()
zip.close()
return album

View File

@ -0,0 +1,107 @@
#category-list li{
font-size: 120%;
padding-bottom: 15px;
}
#category-list {
padding-bottom: 10px;
}
#controls {
font-size: 90%;
}
#controls .controls-group {
padding-top: 10px;
}
.image-description {
padding: 10px 0 10px 0;
}
.navigation {
text-align: center;
padding: 0 0 10px 0;
font-size: 110%;
}
.navigation .next-link {
margin-left: 100px;
}
img.current {
border: 1px red solid;
}
#image-view img.preview {
display: block;
margin: 0 auto 0 auto;
}
#image-view {
margin-right: 300px;
}
.album-list .album {
width: 160px;
height: 200px;
float: left;
padding: 5px;
margin: 10px;
}
.album-name {
width: 100%;
text-align: center;
}
.album-user {
width: 100%;
text-align: center;
font-size: 80%;
color: #CCC;
}
.album-head {
height: 150px;
width: 150px;
display: table-cell;
vertical-align: middle;
text-align: center;
}
.album-head a {
text-align: center;
}
.user-info {
padding: 20px 0;
}
.image-preview {
float: left;
width: 130px;
padding: 5px;
height: 160px;
}
.image-preview .image-title {
font-size: 80%;
}
.extra-fields {
font-size: 80%;
margin: 10px 0;
}
.extra-fields label {
color: #666666;
}
.basic-fields, .extra-fields {
display: block;
float: left;
}
.pagination .disabled {
display: none;
}

View File

@ -0,0 +1,23 @@
{% load thumbnail %}
<div id='gallery'>
{% for image in album.images.all %}
{% thumbnail image.image "120x120" crop="center" as im %}
{% thumbnail image.image "600x600" as full %}
<a rel='gallery[pp_gal]' href="{{ full.url }}">
<img class="preview" {% if image.title %} alt="{{ image.title }}" {% endif %} src="{{ im.url }}">
</a>
{% endthumbnail %}
{% endthumbnail %}
{% endfor %}
<script type="text/javascript" charset="utf-8">
$(function() {
$("a[rel^='gallery']").prettyPhoto({
allow_resize: true,
changepicturecallback: function() {
$(".pp_overlay").css("height", $(document).height());
}
});
});
</script>
</div>

View File

@ -0,0 +1 @@
{% include 'cms/plugins/imagestore_album_carousel_base.html' %}

View File

@ -0,0 +1,28 @@
{% load thumbnail %}
<div id='examples'>
<ul id='carusel{{ carousel.id }}' class="{{ carousel.skin }}" >
{% for image in images %}
{% thumbnail image.image carousel.size crop="center" as im %}
{% thumbnail image.image carousel.full_size as full %}
<li><a rel='gallery{{ carousel.id }}[pp_gal]' href="{{ full.url }}">
<img class="preview" {% if image.title %} alt="{{ image.title }}" {% endif %} src="{{ im.url }}">
</a></li>
{% endthumbnail %}
{% endthumbnail %}
{% endfor %}
</ul>
<script type="text/javascript">
$(function(){
$('#carusel{{ carousel.id }}').jcarousel();
$("a[rel^='gallery{{ carousel.id }}']").prettyPhoto({
allow_resize: true,
changepicturecallback: function() {
$(".pp_overlay").css("height", $(document).height());
}
});
})
</script>
</div>

View File

@ -0,0 +1,14 @@
{% extends "imagestore/base.html" %}
{% load i18n %}
{% block content %}
<p>{% trans "Are you sure that you would like to delete this album?" %}</p>
<form method="post" action=".">
{% csrf_token %}
<p>
<a class='btn' href="{{ post.get_absolute_url }}">← {% trans "No, take me back" %}</a>
<input type="submit" class='btn danger' value="{% trans 'Yes, I am sure' %}" />
</p>
</form>
{% endblock %}

View File

@ -0,0 +1,70 @@
{% extends "imagestore/base.html" %}
{% load i18n %}
{% load thumbnail %}
{% block title %}
{% if view_user %}
{% trans "Albums for user" %} {{ view_user.username }}
{% else %}
{% trans "All albums" %}
{% endif %}
{% endblock %}
{% block imagestore-breadcrumb %}
<li>
{% if view_user %}
{% trans "Albums for user" %} {{ view_user.username }}
{% else %}
{% trans "All albums" %}
{% endif %}
</li>
{% endblock %}
{% block imagestore-info %}
{% if view_user and IMAGESTORE_SHOW_USER %}
{% with view_user.get_profile as profile %}
{% include "imagestore/user_info.html" %}
{% endwith %}
{% endif %}
{% endblock %}
{% block imagestore-related %}
{% include "imagestore/tag-cloud.html" %}
{% endblock %}
{% block content %}
<h1>{% if view_user %}
{% trans "Albums for user" %} {{ view_user.username }}
{% else %}
{% trans "All albums" %}
{% endif %}</h1>
{% include "imagestore/pagination.html" %}
<div class='album-list'>
{% for album in album_list %}
{% if album.get_head or album.user == request.user %}
<div class='album'>
<div class='album-head'>
<a href="{{ album.get_absolute_url }}">
{% if album.get_head %}
{% thumbnail album.get_head.image "150x150" crop='center' as album_head %}
<img class="preview" {% if album.name %} alt="{{ album.name }}" {% endif %} src="{{ album_head.url }}">
{% endthumbnail %}
{% else %}
[{% trans "Empty album" %}]
{% endif %}
<br>
<span class="album-name">{{ album.name }}</span>
{% if not view_user and IMAGESTORE_SHOW_USER %}
<br>
<span class="album-user">
{% trans "user" %}: {{ album.user.username }}
</span>
{% endif %}
</a>
</div>
</div>
{% endif %}
{% endfor %}
</div>
{% include "imagestore/pagination.html" %}
{% endblock %}

View File

@ -0,0 +1,43 @@
{% extends IMAGESTORE_TEMPLATE|default:"base.html" %}
{% load i18n %}
{% block head %}
{% if IMAGESTORE_LOAD_CSS %}
<link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}imagestore.css" media="screen" />
{% endif %}
{% endblock %}
{% block breadcrumb %}
<ul class='breadcrumb'>
{% if request.path != '/' %}
<li><a href="/">{% trans "Home" %}</a> <span class="divider">/</span></li>
{% endif %}
{% if request.path != imagestore_index_url %}
<li><a href="{{ imagestore_index_url }}">{% trans "Gallery" %}</a> <span class="divider">/</span></li>
{% endif %}
{% block imagestore-breadcrumb %}
{% endblock %}
</ul>
{% endblock %}
{% block content %}
{% endblock content %}
{% block content-related %}
{% block imagestore-info %}
{% endblock %}
<div id="controls">
<ul>
{% if imagestore_perms.add_image or request.user.is_superuser %}
<li><a href={% url imagestore:upload %}>{% trans "Upload image" %}</a></li>
{% endif %}
{% if imagestore_perms.add_album or request.user.is_superuser %}
<li><a href={% url imagestore:create-album %}>{% trans "Create new album" %}</a></li>
{% endif %}
{% block controls %}
{% endblock controls %}
</ul>
</div>
{% block imagestore-related %}
{% endblock %}
{% endblock %}

View File

@ -0,0 +1,33 @@
{% extends "imagestore/base.html" %}
{% load i18n %}
{% load thumbnail %}
{% block title %}
{% trans "Create album" %}
{% endblock %}
{% block imagestore-breadcrumb %}
<li>
{% if object %}
{% trans "Edit album" %}: {{ object.name }}
{% else %}
{% trans "Create album" %}
{% endif %}
</li>
{% endblock %}
{% block content %}
<h1>
{% if object %}
{% trans "Edit album" %}: {{ object.name }}
{% else %}
{% trans "Create album" %}
{% endif %}
</h1>
<form action="." method="post" class='album-form'>
{% csrf_token %}
{{ form.as_p }}
<input type="submit" value="{% trans "Save" %}" class='btn success'>
</form>
{% endblock content %}

View File

@ -0,0 +1,32 @@
{% extends "imagestore/base.html" %}
{% load i18n %}
{% load thumbnail %}
{% block title %}
{% trans "Upload image" %}
{% endblock %}
{% block head %}
{{ block.super }}
<script src="{{ STATIC_URL }}autocomplete.js"></script>
<script>
$(function(){
completeField('#id_tags', '{% url imagestore:autocomplete "tag" %}');
completeField('#id_place_text', '{% url imagestore:autocomplete "place" %}');
})
</script>
{% endblock %}
{% block imagestore-breadcrumb %}
<li>{% trans "Upload image" %}</li>
{% endblock %}
{% block content %}
<h1>{% trans "Upload image" %}</h1>
<form action="." method="post" enctype="multipart/form-data" class='upload-image'>
{% csrf_token %}
{{ form.as_p }}
<input type="submit" value="{% trans "Upload" %}" class='btn success'>
</form>
{% endblock content %}

View File

@ -0,0 +1,9 @@
{% if album %}
{% url imagestore:image-album album_id=album.id pk=image.id %}
{% else %}
{% if tag %}
{% url imagestore:image-tag tag=tag pk=image.id %}
{% else %}
{{ image.get_absolute_url }}
{% endif %}
{% endif %}

View File

@ -0,0 +1,15 @@
{% load i18n %}
{% load thumbnail %}
<div id="image-thumbnails">
{% for image in image_list %}
{% thumbnail image.image "120x120" crop="center" as im %}
<a class="thumb" rel='gallery-image[ilist]' href="{{ image.get_absolute_url }}">
<img class="preview" {% if image.title %} alt="{{ image.title }}" {% endif %} src="{{ im.url }}">
</a>
{% endthumbnail %}
{% endfor %}
{% include "imagestore/pagination.html" %}
</div>

View File

@ -0,0 +1,16 @@
{% load i18n %}
{% if view_user %}
{% if scope_tag %}<{{ scope_tag }} class='scope-view-user'>{% endif %}
{% trans "User" %}: {{ view_user.username }}
{% if scope_tag %}</{{ scope_tag }}>{% endif %}
{% endif %}
{% if album %}
{% if scope_tag %}<{{ scope_tag }} class='scope-album'>{% endif %}
{% trans "Album" %}: {{ album.name }}
{% if scope_tag %}</{{ scope_tag }}>{% endif %}
{% endif %}
{% if tag %}
{% if scope_tag %}<{{ scope_tag }} class='scope-album'>{% endif %}
{% trans "Tag" %}: {{ tag }}
{% if scope_tag %}</{{ scope_tag }}>{% endif %}
{% endif %}

View File

@ -0,0 +1,88 @@
{% extends "imagestore/base.html" %}
{% load i18n %}
{% load thumbnail %}
{% load tagging_tags %}
{% block title %}
{% trans "Image" %} - {{ image.title }}
{% endblock %}
{% block imagestore-breadcrumb %}
{% if view_user and IMAGESTORE_SHOW_USER %}
<li class='scope-view-user'><a href="{% url imagestore:user-images username=view_user.username %}">{% trans "User" %}: {{ view_user.username }}</a> <span class="divider">/</span></li>
{% endif %}
{% if album %}
<li class='scope-album'><a href="{{ album.get_absolute_url }}">{% trans "Album" %}: {{ album.name }}</a> <span class="divider">/</span></li>
{% endif %}
{% if tag %}
<li class='scope-tag'><a href="{% url imagestore:tag tag=tag %}">{% trans "Tag" %}: {{ tag }}</a> <span class="divider">/</span></li>
{% endif %}
<li>
{% if image.title %}
{{ image.title }}
{% else %}
{{ image.id }}
{% endif %}
</li>
{% endblock %}
{% block imagestore-info %}
<div class='user-info'>
{% if IMAGESTORE_SHOW_USER %}
{% with image.user.get_profile as profile %}
{% include "imagestore/user_info.html" %}
{% endwith %}
{% endif %}
</div>
{% endblock %}
{% block content %}
{% if image.title %}<h1>{{ image.title }}</h1>{% endif %}
{% if album or tag or view_user %}
<h2>
{% include "imagestore/image-scope.html" %}
</h2>
{% endif %}
<div class="image-description">
{{ image.description }}
</div>
<div id="image-view">
<div class="navigation">
{% if previous %} <a class="previous-link" href="
{% with previous as image %}
{% include "imagestore/image-href.html" %}
{% endwith %}
">← {% trans "previous image" %}</a> {% endif %}
{% if next %} <a class="next-link" href="{% with next as image %}
{% include "imagestore/image-href.html" %}
{% endwith %}">{% trans "next image" %} →</a> {% endif %}
</div>
{% thumbnail image.image "800x800" as full_im %}
<img class="preview" {% if image.title %} alt="{{ image.title }}" {% endif %} src="{{ full_im.url }}">
{% endthumbnail %}
</div>
{% endblock content %}
{% block controls %}
{% if request.user == image.user or perms.imagestore.moderate_images %}
<li><a href="{% url imagestore:update-image image.id %}">{% trans "Edit info" %}</a></li>
<li><a href="{% url imagestore:delete-image image.id %}">{% trans "Delete image" %}</a></li>
{% endif %}
{% endblock %}
{% block imagestore-related %}
<div class="tagging">
<h2>{% trans "Tags" %}</h2>
{% tags_for_object image as itags %}
{% for tag in itags %}
<a href="{% url imagestore:tag tag.name %}">{{ tag.name }}</a>
{% endfor %}
</div>
{% if image.place %}
<div class='place'>
<h2>{% trans "Place" %}</h2>
<a href="{{ image.place.get_absolute_url }}">{{ image.place.name }} →</a>
</div>
{% endif %}
{% endblock %}

View File

@ -0,0 +1,14 @@
{% extends "imagestore/base.html" %}
{% load i18n %}
{% block content %}
<p>{% trans "Are you sure that you would like to delete this image?" %}</p>
<form method="post" action=".">
{% csrf_token %}
<p>
<a class='btn' href="{{ post.get_absolute_url }}">← {% trans "No, take me back" %}</a>
<input type="submit" class='btn danger' value="{% trans 'Yes, I am sure' %}" />
</p>
</form>
{% endblock %}

View File

@ -0,0 +1,14 @@
{% extends "imagestore/base.html" %}
{% load i18n %}
{% block content %}
<p>{% trans "Are you sure that you would like to delete this image?" %}</p>
<form method="post" action=".">
{% csrf_token %}
<p>
<a class='btn' href="{{ post.get_absolute_url }}">← {% trans "No, take me back" %}</a>
<input type="submit" class='btn danger' value="{% trans 'Yes, I am sure' %}" />
</p>
</form>
{% endblock %}

View File

@ -0,0 +1,60 @@
{% extends "imagestore/base.html" %}
{% load i18n %}
{% load thumbnail %}
{% block imagestore-breadcrumb %}
{% with "li" as scope_tag %}
{% include "imagestore/image-scope.html" %}
{% endwith %}
{% endblock %}
{% block title %}
{% include "imagestore/image-scope.html" %}
{% endblock %}
{% block imagestore-info %}
{% if view_user and IMAGESTORE_SHOW_USER %}
{% with view_user.get_profile as profile %}
{% include "imagestore/user_info.html" %}
{% endwith %}
{% endif %}
{% if album and IMAGESTORE_SHOW_USER %}
{% with album.user.get_profile as profile %}
{% include "imagestore/user_info.html" %}
{% endwith %}
{% endif %}
{% endblock %}
{% block controls %}
{% if album %}
{% if request.user == album.user or perms.imagestore.moderate_albums %}
<li><a href='{% url imagestore:update-album pk=album.pk %}'>{% trans "Edit album" %}</a></li>
{% endif %}
{% endif %}
{% endblock %}
{% block content %}
<h1>
{% include "imagestore/image-scope.html" %}
</h1>
{% include "imagestore/pagination.html" %}
<div id="image-thumbnails">
{% for image in image_list %}
<div class='image-preview'>
{% thumbnail image.image "120x120" crop="center" as im %}
<a class="thumb" rel='gallery-image[ilist]' href="{% include "imagestore/image-href.html" %}">
<img class="preview" {% if image.title %} alt="{{ image.title }}" {% endif %} src="{{ im.url }}">
{% if image.title %}
<br><span class='image-title'>{{ image.title }}</span>
{% endif %}
</a>
{% endthumbnail %}
</div>
{% endfor %}
</div>
{% include "imagestore/pagination.html" %}
{% endblock %}

View File

@ -0,0 +1,26 @@
{% load i18n %}
{% if is_paginated %}
<div class="pagination">
<ul>
<li class="prev {% if not page_obj.has_previous %}disabled{% endif %}">
<a href="{% if page_obj.has_previous %}?page={{ page_obj.previous_page_number }}{% else %}#{% endif %}" >← {% trans "previous page" %}</a>
</li>
{% for page in page_obj.pages %}
{% if page %}
<li {% ifequal page page_obj.number %}class="disabled"{% endifequal %}>
<a href="?{{ page.querystring }}" class="page">{{ page }}</a>
</li>
{% else %}
<li class="disabled">
...
</li>
{% endif %}
{% endfor %}
<li class="next {% if not page_obj.has_next %}disabled{% endif %}">
<a href="{% if page_obj.has_next %}?page={{ page_obj.next_page_number }}{% else %}#{% endif %}" >{% trans "next page" %} →</a>
</li>
</ul>
</div>
{% endif %}

View File

@ -0,0 +1,20 @@
<link rel="stylesheet" href="{{ STATIC_URL }}prettyphoto/css/prettyPhoto.css" type="text/css" media="screen" charset="utf-8" />
<script src="{{ STATIC_URL }}prettyphoto/js/jquery.prettyPhoto.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript" charset="utf-8">
var prettyparams = {
animation_speed: 'fast',
slideshow: 3000,
autoplay_slideshow: false,
opacity: 0.7,
show_title: true,
allow_resize: true,
default_width: 1000,
default_height: 344,
counter_separator_label: '/',
theme: 'facebook',
overlay_gallery: true,
changepicturecallback: function() {$pp_overlay.css({'height':$(document).height()})},
};
$(function(){$("a[rel^='gallery-image']").prettyPhoto(prettyparams)});
</script>

View File

@ -0,0 +1,12 @@
{% load tagging_tags %}
{% load i18n %}
{% if IMAGESTORE_SHOW_TAGS %}
<div id="tag-cloud">
<h1>{% trans "Tags" %}</h1>
{% tag_cloud_for_model imagestore.Image as image_tags %}
{% for tag in image_tags %}
<a href={% url imagestore:tag tag.name %}>{{ tag.name }}</a>
{% endfor %}
</div>
{% endif %}

View File

@ -0,0 +1,21 @@
{% extends "imagestore/base.html" %}
{% load i18n %}
{% load thumbnail %}
{% block title %}
{% trans "Gallery" %} - {% trans "Tag" %}: {{ tag }}
{% endblock %}
{% block imagestore-breadcrumb %}
<li>{% trans "Tag" %}: {{ tag }}</li>
{% endblock %}
{% block content %}
<h1>{% trans "Tag" %} - {{ tag }}</h1>
{% include "imagestore/image-list.html" %}
{% endblock content %}
{% block content-related %}
{% include "imagestore/tag-cloud.html" %}
{% endblock %}

View File

@ -0,0 +1,19 @@
{% load i18n %}
{% load thumbnail %}
<div class="user-info">
<h2>{% trans "User" %}</h2>
<div class="avatar">
<a href="{{ profile.get_absolute_url }}">
{% thumbnail profile.avatar "80x80" as avatar %}
<img src="{{ avatar.url }}" alt="avatar">
{% empty %}
{% endthumbnail %}
</a>
</div>
<div class="user-name">
<a href="{{ profile.get_absolute_url }}">
{{ profile.user.username }}
</a>
</div>
</div>

178
itf/imagestore/tests.py Normal file
View File

@ -0,0 +1,178 @@
#!/usr/bin/env python
# vim:fileencoding=utf-8
__author__ = 'zeus'
from django.test import TestCase
from django.test.client import Client
from django.core.urlresolvers import reverse
from models import *
import os
from django.contrib.auth.models import User
from django.db import models
try:
from lxml import html
except:
raise ImportError('Imagestore require lxml for self-testing')
class ImagestoreTest(TestCase):
def setUp(self):
self.image_file = open(os.path.join(os.path.dirname(__file__), 'test_img.jpg'))
self.user = User.objects.create_user('zeus', 'zeus@example.com', 'zeus')
self.client = Client()
self.album = Album(name='test album', user=self.user)
self.album.save()
def _upload_test_image(self, username='zeus', password='zeus'):
self.client.login(username=username, password=password)
self.image_file = open(os.path.join(os.path.dirname(__file__), 'test_img.jpg'))
response = self.client.get(reverse('imagestore:upload'))
self.assertEqual(response.status_code, 200)
tree = html.fromstring(response.content)
values = dict(tree.xpath('//form[@method="post"]')[0].form_values())
values['image'] = self.image_file
values['album'] = Album.objects.filter(user=self.user)[0].id
response = self.client.post(reverse('imagestore:upload'), values, follow=True)
return response
def _create_test_album(self, username='zeus', password='zeus'):
self.client.login(username=username, password=password)
response = self.client.get(reverse('imagestore:create-album'))
self.assertEqual(response.status_code, 200)
tree = html.fromstring(response.content)
values = dict(tree.xpath('//form[@method="post"]')[0].form_values())
values['name'] = 'test album creation'
response = self.client.post(reverse('imagestore:create-album'), values, follow=True)
return response
def test_empty_index(self):
response = self.client.get(reverse('imagestore:index'))
self.assertEqual(response.status_code, 200)
def test_empty_album(self):
self.album.is_public = False
self.album.save()
response = self.client.get(self.album.get_absolute_url())
self.assertTrue(response.status_code == 403)
self.client.login(username='zeus', password='zeus')
self.user.is_superuser = True
self.user.save()
response = self.client.get(self.album.get_absolute_url())
self.assertEqual(response.status_code, 200)
def test_user(self):
response = self.client.get(reverse('imagestore:user', kwargs={'username': 'zeus'}))
self.assertEqual(response.status_code, 200)
def test_album_creation(self):
response = self._create_test_album()
self.assertEqual(response.status_code, 200)
def test_album_edit(self):
response = self._create_test_album()
album_id = Album.objects.get(name='test album creation').id
self.client.login(username='zeus', password='zeus')
response = self.client.get(reverse('imagestore:update-album', kwargs={'pk': album_id}))
self.assertEqual(response.status_code, 200)
tree = html.fromstring(response.content)
values = dict(tree.xpath('//form[@method="post"]')[0].form_values())
values['name'] = 'test album update'
self.client.post(reverse('imagestore:update-album', kwargs={'pk': album_id}), values, follow=True)
self.assertEqual(response.status_code, 200)
self.assertTrue(Album.objects.get(id=album_id).name == 'test album update')
def test_album_delete(self):
response = self._create_test_album()
self.client.login(username='zeus', password='zeus')
album_id = Album.objects.get(name='test album creation').id
response = self.client.post(reverse('imagestore:delete-album', kwargs={'pk': album_id}), follow=True)
self.assertEqual(response.status_code, 200)
self.assertTrue(len(Album.objects.filter(id=album_id)) == 0)
def test_image_upload(self):
response = self._create_test_album()
response = self._upload_test_image()
self.assertEqual(response.status_code, 200)
img_url = Image.objects.get(user__username='zeus').get_absolute_url()
response = self.client.get(img_url)
self.assertEqual(response.status_code, 200)
self.test_user()
def test_tagging(self):
response = self._create_test_album()
self.client.login(username='zeus', password='zeus')
response = self.client.get(reverse('imagestore:upload'))
self.assertEqual(response.status_code, 200)
tree = html.fromstring(response.content)
values = dict(tree.xpath('//form[@method="post"]')[0].form_values())
values['image'] = self.image_file
values['tags'] = 'one, tow, three'
values['album'] = Album.objects.filter(user=self.user)[0].id
self.client.post(reverse('imagestore:upload'), values, follow=True)
self.assertEqual(response.status_code, 200)
response = self.client.get(reverse('imagestore:tag', kwargs={'tag': 'one'}))
self.assertEqual(response.status_code, 200)
self.assertTrue(len(response.context['image_list']) == 1)
def test_delete(self):
User.objects.create_user('bad', 'bad@example.com', 'bad')
response = self._create_test_album()
self._upload_test_image()
self.client.login(username='bad', password='bad')
image_id = Image.objects.get(user__username='zeus').id
response = self.client.post(reverse('imagestore:delete-image', kwargs={'pk': image_id}), follow=True)
self.assertEqual(response.status_code, 404)
self.client.login(username='zeus', password='zeus')
response = self.client.post(reverse('imagestore:delete-image', kwargs={'pk': image_id}), follow=True)
self.assertEqual(response.status_code, 200)
self.assertEqual(len(Image.objects.all()), 0)
def test_update_image(self):
self._upload_test_image()
self.client.login(username='zeus', password='zeus')
image_id = Image.objects.get(user__username='zeus').id
response = self.client.get(reverse('imagestore:update-image', kwargs={'pk': image_id}), follow=True)
self.assertEqual(response.status_code, 200)
tree = html.fromstring(response.content)
values = dict(tree.xpath('//form[@method="post"]')[0].form_values())
values['tags'] = 'one, tow, three'
values['title'] = 'changed title'
values['album'] = Album.objects.filter(user=self.user)[0].id
self.client.post(reverse('imagestore:update-image', kwargs={'pk': image_id}), values, follow=True)
self.assertEqual(response.status_code, 200)
self.assertTrue(Image.objects.get(user__username='zeus').title == 'changed title')
def test_prev_next_with_ordering(self):
self.test_album_creation()
for i in range(1, 6):
self._upload_test_image()
img = Image.objects.order_by('-id')[0]
img.order = i
img.save()
# Swap two id's
im1 = Image.objects.get(order=2)
im2 = Image.objects.get(order=4)
im1.order, im2.order = 4, 2
im1.save()
im2.save()
response = self.client.get(Image.objects.get(order=3).get_absolute_url())
self.assertEqual(response.context['next'], im1)
self.assertEqual(response.context['previous'], im2)
def test_album_order(self):
self.album.delete()
a1 = Album.objects.create(name='b2', order=1, user=self.user)
a2 = Album.objects.create(name='a1', order=2, user=self.user)
response = self.client.get(reverse('imagestore:index'))
self.assertEqual(response.status_code, 200)
self.assertEqual(response.context['object_list'][0].name, 'b2')
self.assertEqual(response.context['object_list'][1].name, 'a1')
a1.order, a2.order = 2, 1
a1.save()
a2.save()
response = self.client.get(reverse('imagestore:index'))
self.assertEqual(response.status_code, 200)
self.assertEqual(response.context['object_list'][0].name, 'a1')
self.assertEqual(response.context['object_list'][1].name, 'b2')

43
itf/imagestore/urls.py Normal file
View File

@ -0,0 +1,43 @@
from django.conf.urls.defaults import *
from tagging.models import Tag
from views import AlbumListView, ImageListView, UpdateImage, UpdateAlbum, CreateImage, CreateAlbum, DeleteImage, DeleteAlbum, ImageView
from fancy_autocomplete.views import AutocompleteSite
autocomletes = AutocompleteSite()
autocomletes.register(
'tag',
queryset=Tag.objects.all(),
search_fields=('name',),
limit=10,
lookup='istartswith',
)
urlpatterns = patterns('imagestore.views',
url(r'^$', AlbumListView.as_view(), name='index'),
url(r'^album/add/$', CreateAlbum.as_view(), name='create-album'),
url(r'^album/(?P<album_id>\d+)/$', ImageListView.as_view(), name='album'),
url(r'^album/(?P<pk>\d+)/edit/$', UpdateAlbum.as_view(), name='update-album'),
url(r'^album/(?P<pk>\d+)/delete/$', DeleteAlbum.as_view(), name='delete-album'),
url(r'^tag/(?P<tag>[^/]+)/$', ImageListView.as_view(), name='tag'),
url(r'^user/(?P<username>\w+)/albums', AlbumListView.as_view(), name='user'),
url(r'^user/(?P<username>\w+)/$', ImageListView.as_view(), name='user-images'),
url(r'^upload/$', CreateImage.as_view(), name='upload'),
url(r'^image/(?P<pk>\d+)/$', ImageView.as_view(), name='image'),
url(r'^album/(?P<album_id>\d+)/image/(?P<pk>\d+)/$', ImageView.as_view(), name='image-album'),
url(r'^tag/(?P<tag>[^/]+)/image/(?P<pk>\d+)/$', ImageView.as_view(), name='image-tag'),
url(r'^image/(?P<pk>\d+)/delete/$', DeleteImage.as_view(), name='delete-image'),
url(r'^image/(?P<pk>\d+)/update/$', UpdateImage.as_view(), name='update-image'),
url(r'^autocomplete/(.*)/$', autocomletes, name='autocomplete')
)

68
itf/imagestore/utils.py Normal file
View File

@ -0,0 +1,68 @@
#!/usr/bin/env python
# vim:fileencoding=utf-8
__author__ = 'zeus'
import os
import uuid
from django.core.exceptions import ImproperlyConfigured
from django.utils.importlib import import_module
from django.conf import settings
UPLOAD_TO = getattr(settings, 'IMAGESTORE_UPLOAD_TO', 'imagestore/')
def load_class(class_path, setting_name=None):
"""
Loads a class given a class_path.
The setting_name parameter is only there for pretty error output, and
therefore is optional
Taken from https://github.com/divio/django-shop/blob/master/shop/util/loader.py
"""
try:
class_module, class_name = class_path.rsplit('.', 1)
except ValueError:
if setting_name:
txt = '%s isn\'t a valid module. Check your %s setting' % (class_path,setting_name)
else:
txt = '%s isn\'t a valid module.' % class_path
raise ImproperlyConfigured(txt)
try:
mod = import_module(class_module)
except ImportError, e:
if setting_name:
txt = 'Error importing backend %s: "%s". Check your %s setting' % (class_module, e, setting_name)
else:
txt = 'Error importing backend %s: "%s".' % (class_module, e)
raise ImproperlyConfigured(txt)
try:
clazz = getattr(mod, class_name)
except AttributeError, e:
if setting_name:
txt = 'Backend module "%s" does not define a "%s" class. Check your %s setting. (%s)' % (class_module, class_name, setting_name)
else:
txt = 'Backend module "%s" does not define a "%s" class. (%s)' % (class_module, class_name, e)
raise ImproperlyConfigured(txt)
return clazz
def get_model_string(model_name):
"""
Returns the model string notation Django uses for lazily loaded ForeignKeys
(eg 'auth.User') to prevent circular imports.
This is needed to allow our crazy custom model usage.
Taken from https://github.com/divio/django-shop/blob/master/shop/util/loader.py
"""
class_path = getattr(settings, 'IMAGESTORE_%s_MODEL' % model_name.upper().replace('_', ''), None)
if not class_path:
return 'imagestore.%s' % model_name
else:
klass = load_class(class_path)
return '%s.%s' % (klass._meta.app_label, klass.__name__)
def get_file_path(instance, filename):
ext = filename.split('.')[-1]
filename = "%s.%s" % (uuid.uuid4(), ext)
return os.path.join(UPLOAD_TO, filename)

241
itf/imagestore/views.py Normal file
View File

@ -0,0 +1,241 @@
from django.core.exceptions import PermissionDenied
from django.core.urlresolvers import reverse
from django.utils.decorators import method_decorator
from imagestore.models import Album, Image
from imagestore.models import image_applabel, image_classname
from imagestore.models import album_applabel, album_classname
from django.shortcuts import get_object_or_404
from django.http import Http404, HttpResponseRedirect
from django.conf import settings
from django.contrib.auth.models import User
from django.contrib.auth.decorators import permission_required
from django.contrib.auth.decorators import login_required
from django.utils.translation import ugettext_lazy as _
from django.views.generic import ListView, DetailView, CreateView, UpdateView, DeleteView
from tagging.models import TaggedItem
from tagging.utils import get_tag
from django.contrib.contenttypes.models import ContentType
from utils import load_class
from django.db.models import Q
IMAGESTORE_IMAGES_ON_PAGE = getattr(settings, 'IMAGESTORE_IMAGES_ON_PAGE', 20)
IMAGESTORE_ON_PAGE = getattr(settings, 'IMAGESTORE_ON_PAGE', 20)
ImageForm = load_class(getattr(settings, 'IMAGESTORE_IMAGE_FORM', 'imagestore.forms.ImageForm'))
AlbumForm = load_class(getattr(settings, 'IMAGESTORE_ALBUM_FORM', 'imagestore.forms.AlbumForm'))
class AlbumListView(ListView):
context_object_name = 'album_list'
template_name = 'imagestore/album_list.html'
paginate_by = getattr(settings, 'IMAGESTORE_ALBUMS_ON_PAGE', 20)
allow_empty = True
def get_queryset(self):
albums = Album.objects.filter(is_public=True).select_related('head')
self.e_context = dict()
if 'username' in self.kwargs:
user = get_object_or_404(User, username=self.kwargs['username'])
albums = albums.filter(user=user)
self.e_context['view_user'] = user
return albums
def get_context_data(self, **kwargs):
context = super(AlbumListView, self).get_context_data(**kwargs)
context.update(self.e_context)
return context
def get_images_queryset(self):
images = Image.objects.all()
self.e_context = dict()
if 'tag' in self.kwargs:
tag_instance = get_tag(self.kwargs['tag'])
if tag_instance is None:
raise Http404(_('No Tag found matching "%s".') % self.kwargs['tag'])
self.e_context['tag'] = tag_instance
images = TaggedItem.objects.get_by_model(images, tag_instance)
if 'username' in self.kwargs:
user = get_object_or_404(User, username=self.kwargs['username'])
self.e_context['view_user'] = user
images = images.filter(user=user)
if 'album_id' in self.kwargs:
album = get_object_or_404(Album, id=self.kwargs['album_id'])
self.e_context['album'] = album
images = images.filter(album=album)
if (not album.is_public) and\
(self.request.user != album.user) and\
(not self.request.user.has_perm('imagestore.moderate_albums')):
raise PermissionDenied
return images
class ImageListView(ListView):
context_object_name = 'image_list'
template_name = 'imagestore/image_list.html'
paginate_by = getattr(settings, 'IMAGESTORE_IMAGES_ON_PAGE', 20)
allow_empty = True
get_queryset = get_images_queryset
def get_context_data(self, **kwargs):
context = super(ImageListView, self).get_context_data(**kwargs)
context.update(self.e_context)
return context
class ImageView(DetailView):
context_object_name = 'image'
template_name = 'imagestore/image.html'
get_queryset = get_images_queryset
def get_context_data(self, **kwargs):
context = super(ImageView, self).get_context_data(**kwargs)
image = context['image']
# Check thant album is public or user have rights to see it
if image.album:
if (not image.album.is_public) and\
(self.request.user != image.album.user) and\
(not self.request.user.has_perm('imagestore.moderate_albums')):
raise PermissionDenied
base_qs = self.get_queryset()
count = base_qs.count()
img_pos = base_qs.filter(
Q(order__lt=image.order)|
Q(id__lt=image.id, order=image.order)
).count()
next = None
previous = None
if count - 1 > img_pos:
try:
next = base_qs.filter(
Q(order__gt=image.order)|
Q(id__gt=image.id, order=image.order)
)[0]
except IndexError:
pass
if img_pos > 0:
try:
previous = base_qs.filter(
Q(order__lt=image.order)|
Q(id__lt=image.id, order=image.order)
).order_by('-order', '-id')[0]
except IndexError:
pass
context['next'] = next
context['previous'] = previous
context.update(self.e_context)
return context
class CreateAlbum(CreateView):
template_name = 'imagestore/forms/album_form.html'
model = Album
form_class = AlbumForm
@method_decorator(login_required)
@method_decorator(permission_required('%s.add_%s' % (album_applabel, album_classname)))
def dispatch(self, *args, **kwargs):
return super(CreateAlbum, self).dispatch(*args, **kwargs)
def form_valid(self, form):
self.object = form.save(commit=False)
self.object.user = self.request.user
self.object.save()
return HttpResponseRedirect(self.get_success_url())
def filter_album_queryset(self):
if self.request.user.has_perm('imagestore.moderate_albums'):
return Album.objects.all()
else:
return Album.objects.filter(user=self.request.user)
class UpdateAlbum(UpdateView):
template_name = 'imagestore/forms/album_form.html'
model = Album
form_class = AlbumForm
get_queryset = filter_album_queryset
@method_decorator(login_required)
@method_decorator(permission_required('%s.add_%s' % (album_applabel, album_classname)))
def dispatch(self, *args, **kwargs):
return super(UpdateAlbum, self).dispatch(*args, **kwargs)
class DeleteAlbum(DeleteView):
template_name = 'imagestore/album_delete.html'
model = Album
def get_success_url(self):
return reverse('imagestore:index')
get_queryset = filter_album_queryset
@method_decorator(login_required)
@method_decorator(permission_required('%s.change_%s' % (album_applabel, album_classname)))
def dispatch(self, *args, **kwargs):
return super(DeleteAlbum, self).dispatch(*args, **kwargs)
class CreateImage(CreateView):
template_name = 'imagestore/forms/image_form.html'
model = Image
form_class = ImageForm
@method_decorator(login_required)
@method_decorator(permission_required('%s.add_%s' % (image_applabel, image_classname)))
def dispatch(self, *args, **kwargs):
return super(CreateImage, self).dispatch(*args, **kwargs)
def get_form(self, form_class):
return form_class(user=self.request.user, **self.get_form_kwargs())
def form_valid(self, form):
self.object = form.save(commit=False)
self.object.user = self.request.user
self.object.save()
if self.object.album:
self.object.album.save()
return HttpResponseRedirect(self.get_success_url())
def get_edit_image_queryset(self):
if self.request.user.has_perm('%s.moderate_%s' % (image_applabel, image_classname)):
return Image.objects.all()
else:
return Image.objects.filter(user=self.request.user)
class UpdateImage(UpdateView):
template_name = 'imagestore/forms/image_form.html'
model = Image
form_class = ImageForm
get_queryset = get_edit_image_queryset
def get_form(self, form_class):
return form_class(user=self.object.user, **self.get_form_kwargs())
@method_decorator(login_required)
@method_decorator(permission_required('%s.change_%s' % (image_applabel, image_classname)))
def dispatch(self, *args, **kwargs):
return super(UpdateImage, self).dispatch(*args, **kwargs)
class DeleteImage(DeleteView):
template_name = 'imagestore/image_delete.html'
model = Image
def get_success_url(self):
return reverse('imagestore:index')
get_queryset = get_edit_image_queryset
@method_decorator(login_required)
@method_decorator(permission_required('%s.delete_%s' % (image_applabel, image_classname)))
def dispatch(self, *args, **kwargs):
return super(DeleteImage, self).dispatch(*args, **kwargs)

View File

@ -9,6 +9,8 @@ from crispy_forms.helper import FormHelper
from crispy_forms.layout import Submit
from django.contrib.contenttypes.models import ContentType
from app.forms import *
from imagestore.forms import AlbumForm
#Forms and Inlines for Generic Classes
@ -45,8 +47,7 @@ class PadmaClipForm(ItfForm):
PadmaClipsInline = itf_inlineformset_factory(PadmaClip, extra=1, is_generic=True, form=PadmaClipForm, title="Videos")
AlbumsInline = itf_inlineformset_factory(Album, extra=1, is_generic=True, form=AlbumForm, title="Photo Albums")
#Popup Form Classes:
class PopupPersonForm(PopupForm):
@ -135,7 +136,7 @@ PersonsInline = itf_inlineformset_factory(TheatreGroup, PersonGroup, form=GroupP
class TheatreGroupForm(ItfForm):
inlines = [PersonsInline, BuzzItemsInline, AwardsInline, LocationsInline]
inlines = [PersonsInline, BuzzItemsInline, AwardsInline, LocationsInline, AlbumsInline]
class Meta:
model = TheatreGroup

View File

@ -6,7 +6,7 @@ from django.contrib.localflavor.in_.forms import INZipCodeField
#from ox.django.fields import DictField
from django.contrib.contenttypes.models import ContentType
from django.contrib.contenttypes import generic
from imagestore.models import Album
GENDER_CHOICES = (
('M', 'Male'),
@ -233,7 +233,8 @@ class TheatreGroup(ItfModel):
buzzitems = generic.GenericRelation("BuzzItem")
website = models.URLField(blank=True, verify_exists=False)
resources = models.ManyToManyField("Resource", blank=True, null=True)
locations = generic.GenericRelation("Location"),
locations = generic.GenericRelation("Location")
# albums = generic.GenericRelation(Album)
nature_of_work = models.ManyToManyField("GroupOccupation", blank=True, null=True, through="GroupGroupOccupation")
# locations = models.ManyToManyField("Location", blank=True, null=True, related_name="theatregroup_locations")
@ -250,11 +251,11 @@ class TheatreGroup(ItfModel):
'name': self.name,
'email': self.email,
'tel':self.tel,
'nature_of_work': [ obj for obj in self.nature_of_work.all().order_by('groupgroupoccupation__is_main')],
'venues': [obj for obj in self.locations],
'nature_of_work': [obj for obj in self.nature_of_work.all().order_by('groupgroupoccupation__is_main')],
'venues': [obj for obj in self.locations.all()],
'trainings': [obj for obj in self.trainings.all()],
'languages': [obj.name for obj in self.languages.all()],
'venues': [obj for obj in self.locations],
#'venues': [obj for obj in self.locations],
'founded': self.year_founded,
'about': self.about,
'awards': [obj for obj in self.awards.all()],

View File

@ -213,6 +213,7 @@ INSTALLED_APPS = (
'sorl.thumbnail',
'crispy_forms',
'floppyforms',
'imagestore',
# 'south',
# 'user',
'ckeditor',