Port to new django version - not yet fully working
- location field makes problems
|
@ -2,7 +2,8 @@ from django.http import HttpResponseRedirect
|
|||
from django.conf import settings
|
||||
import re
|
||||
|
||||
class EnforceLoginMiddleware(object):
|
||||
|
||||
class EnforceLoginMiddleware:
|
||||
"""
|
||||
Middlware class which requires the user to be authenticated for all urls except
|
||||
those defined in PUBLIC_URLS in settings.py. PUBLIC_URLS should be a tuple of regular
|
||||
|
@ -14,70 +15,77 @@ class EnforceLoginMiddleware(object):
|
|||
validation on these set SERVE_STATIC_TO_PUBLIC to False.
|
||||
"""
|
||||
|
||||
def __init__(self):
|
||||
self.login_url = getattr(settings, 'LOGIN_URL', '/accounts/login/' )
|
||||
|
||||
if hasattr(settings,'PUBLIC_URLS'):
|
||||
def __init__(self, get_response):
|
||||
self.login_url = getattr(settings, 'LOGIN_URL', '/accounts/login/')
|
||||
self.get_response = get_response
|
||||
|
||||
if hasattr(settings, 'PUBLIC_URLS'):
|
||||
public_urls = [re.compile(url) for url in settings.PUBLIC_URLS]
|
||||
else:
|
||||
public_urls = [(re.compile("^%s/?$" % ( self.login_url[1:] )))]
|
||||
if getattr(settings, 'SERVE_STATIC_TO_PUBLIC', True ):
|
||||
public_urls = [(re.compile("^%s/?$" % (self.login_url[1:])))]
|
||||
if getattr(settings, 'SERVE_STATIC_TO_PUBLIC', True):
|
||||
root_urlconf = __import__(settings.ROOT_URLCONF)
|
||||
public_urls.extend([ re.compile(url.regex)
|
||||
for url in root_urlconf.urls.urlpatterns
|
||||
if url.__dict__.get('_callback_str') == 'django.views.static.serve'
|
||||
])
|
||||
public_urls.extend([re.compile(url.regex)
|
||||
for url in root_urlconf.urls.urlpatterns
|
||||
if url.__dict__.get('_callback_str') == 'django.views.static.serve'
|
||||
])
|
||||
self.public_urls = tuple(public_urls)
|
||||
|
||||
def process_request(self, request):
|
||||
def __call__(self, request):
|
||||
"""
|
||||
Redirect anonymous users to login_url from non public urls
|
||||
"""
|
||||
try:
|
||||
if request.user.is_anonymous():
|
||||
if request.user.is_anonymous:
|
||||
for url in self.public_urls:
|
||||
if url.match(request.path[1:]):
|
||||
return None
|
||||
return HttpResponseRedirect("%s?next=%s" % (self.login_url, request.path))
|
||||
except AttributeError:
|
||||
return HttpResponseRedirect("%s?next=%s" % (self.login_url, request.path))
|
||||
|
||||
|
||||
|
||||
class DetectDevice(object):
|
||||
|
||||
def process_request(self, request):
|
||||
return self.get_response(request)
|
||||
|
||||
|
||||
class DetectDevice:
|
||||
|
||||
def __init__(self, get_response):
|
||||
self.get_response = get_response
|
||||
|
||||
def __call__(self, request):
|
||||
device = self.mobile(request)
|
||||
|
||||
request.device = device
|
||||
|
||||
response = self.get_response(request)
|
||||
return response
|
||||
|
||||
def mobile(self, request):
|
||||
device = {}
|
||||
|
||||
|
||||
ua = request.META.get('HTTP_USER_AGENT', '').lower()
|
||||
|
||||
|
||||
if ua.find("iphone") > 0:
|
||||
device['iphone'] = "iphone" + re.search("iphone os (\d)", ua).groups(0)[0]
|
||||
|
||||
|
||||
if ua.find("ipad") > 0:
|
||||
device['ipad'] = "ipad"
|
||||
|
||||
|
||||
if ua.find("android") > 0:
|
||||
device['android'] = "android" + re.search("android (\d\.\d)", ua).groups(0)[0].translate(None, '.')
|
||||
|
||||
|
||||
if ua.find("blackberry") > 0:
|
||||
device['blackberry'] = "blackberry"
|
||||
|
||||
|
||||
if ua.find("windows phone os 7") > 0:
|
||||
device['winphone7'] = "winphone7"
|
||||
|
||||
|
||||
if ua.find("iemobile") > 0:
|
||||
device['winmo'] = "winmo"
|
||||
|
||||
if not device: # either desktop, or something we don't care about.
|
||||
|
||||
if not device: # either desktop, or something we don't care about.
|
||||
device['baseline'] = "baseline"
|
||||
|
||||
|
||||
# spits out device names for CSS targeting, to be applied to <html> or <body>.
|
||||
device['classes'] = " ".join(v for (k,v) in device.items())
|
||||
|
||||
device['classes'] = " ".join(v for (k, v) in device.items())
|
||||
|
||||
return device
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
# Setting the path
|
||||
|
||||
import os
|
||||
|
||||
gettext = lambda s: s
|
||||
PROJECT_PATH = os.path.abspath(os.path.dirname(__file__))
|
||||
|
||||
|
||||
# Django settings for blechreiz project.
|
||||
|
||||
DEBUG = True
|
||||
|
@ -16,7 +16,6 @@ ADMINS = (
|
|||
|
||||
MANAGERS = ADMINS
|
||||
|
||||
|
||||
DATABASES = {
|
||||
'default': {
|
||||
'ENGINE': 'django.db.backends.sqlite3',
|
||||
|
@ -26,11 +25,10 @@ DATABASES = {
|
|||
|
||||
# Email
|
||||
|
||||
EMAIL_HOST='smtp.blechreiz.com'
|
||||
EMAIL_HOST_USER='m02b721a'
|
||||
EMAIL_HOST_PASSWORD='9Hp4WG5bZ2WVPX5z'
|
||||
EMAIL_USE_TLS=False
|
||||
|
||||
EMAIL_HOST = 'smtp.blechreiz.com'
|
||||
EMAIL_HOST_USER = 'm02b721a'
|
||||
EMAIL_HOST_PASSWORD = '9Hp4WG5bZ2WVPX5z'
|
||||
EMAIL_USE_TLS = False
|
||||
|
||||
# Hosts/domain names that are valid for this site; required if DEBUG is False
|
||||
# See https://docs.djangoproject.com/en/1.5/ref/settings/#allowed-hosts
|
||||
|
@ -78,8 +76,8 @@ STATIC_ROOT = PROJECT_PATH + '/static_collection'
|
|||
# Example: "http://example.com/static/", "http://static.example.com/"
|
||||
STATIC_URL = '/static/'
|
||||
|
||||
LOGIN_URL="/musicians/login"
|
||||
PUBLIC_URLS=( "^musicians/login/?$", "^musicians/login/usernames/?$", "^eventplanner_gcal/gcalApiCallback*")
|
||||
LOGIN_URL = "/musicians/login"
|
||||
PUBLIC_URLS = ("^musicians/login/?$", "^musicians/login/usernames/?$", "^eventplanner_gcal/gcalApiCallback*")
|
||||
|
||||
# Additional locations of static files
|
||||
STATICFILES_DIRS = (
|
||||
|
@ -94,26 +92,42 @@ STATICFILES_DIRS = (
|
|||
STATICFILES_FINDERS = (
|
||||
'django.contrib.staticfiles.finders.FileSystemFinder',
|
||||
'django.contrib.staticfiles.finders.AppDirectoriesFinder',
|
||||
# 'django.contrib.staticfiles.finders.DefaultStorageFinder',
|
||||
)
|
||||
# 'django.contrib.staticfiles.finders.DefaultStorageFinder',
|
||||
)
|
||||
|
||||
# Make this unique, and don't share it with anybody.
|
||||
SECRET_KEY = 'x$8&9s6t%eeg=wyhar87934wh_s$dbpm(73g4ho&n)9_wogj6p'
|
||||
|
||||
# List of callables that know how to import templates from various sources.
|
||||
TEMPLATE_LOADERS = (
|
||||
'django.template.loaders.filesystem.Loader',
|
||||
'django.template.loaders.app_directories.Loader',
|
||||
# 'django.template.loaders.eggs.Loader',
|
||||
)
|
||||
TEMPLATES = [
|
||||
{
|
||||
'BACKEND': 'django.template.backends.django.DjangoTemplates',
|
||||
'DIRS': [
|
||||
PROJECT_PATH + '/templates',
|
||||
],
|
||||
'APP_DIRS': True,
|
||||
'OPTIONS': {
|
||||
'context_processors': [
|
||||
# Insert your TEMPLATE_CONTEXT_PROCESSORS here or use this
|
||||
# list if you haven't customized them:
|
||||
'django.contrib.auth.context_processors.auth',
|
||||
'django.template.context_processors.i18n',
|
||||
'django.template.context_processors.request',
|
||||
'django.template.context_processors.media',
|
||||
'django.template.context_processors.static',
|
||||
'sekizai.context_processors.sekizai',
|
||||
],
|
||||
},
|
||||
},
|
||||
]
|
||||
|
||||
MIDDLEWARE_CLASSES = (
|
||||
'django.middleware.common.CommonMiddleware',
|
||||
MIDDLEWARE = (
|
||||
'django.middleware.security.SecurityMiddleware',
|
||||
'django.contrib.sessions.middleware.SessionMiddleware',
|
||||
'django.middleware.common.CommonMiddleware',
|
||||
'django.middleware.csrf.CsrfViewMiddleware',
|
||||
'django.contrib.auth.middleware.AuthenticationMiddleware',
|
||||
'django.contrib.messages.middleware.MessageMiddleware',
|
||||
'blechreiz.middleware.EnforceLoginMiddleware',
|
||||
#'blechreiz.middleware.EnforceLoginMiddleware',
|
||||
'blechreiz.middleware.DetectDevice',
|
||||
# Uncomment the next line for simple clickjacking protection:
|
||||
# 'django.middleware.clickjacking.XFrameOptionsMiddleware',
|
||||
|
@ -125,20 +139,6 @@ ROOT_URLCONF = 'blechreiz.urls'
|
|||
WSGI_APPLICATION = 'blechreiz.wsgi.application'
|
||||
|
||||
|
||||
TEMPLATE_DIRS = (
|
||||
PROJECT_PATH + '/templates',
|
||||
)
|
||||
|
||||
|
||||
TEMPLATE_CONTEXT_PROCESSORS = (
|
||||
'django.contrib.auth.context_processors.auth',
|
||||
'django.core.context_processors.i18n',
|
||||
'django.core.context_processors.request',
|
||||
'django.core.context_processors.media',
|
||||
'django.core.context_processors.static',
|
||||
'sekizai.context_processors.sekizai',
|
||||
)
|
||||
|
||||
INSTALLED_APPS = (
|
||||
'django.contrib.auth',
|
||||
'django.contrib.contenttypes',
|
||||
|
@ -148,45 +148,40 @@ INSTALLED_APPS = (
|
|||
'django.contrib.staticfiles',
|
||||
'django.contrib.admin',
|
||||
'django.contrib.admindocs',
|
||||
'crispy_forms', # better looking forms ( bootstrap )
|
||||
'sekizai', # for the addtoblock directive in templates
|
||||
'rest_framework', # for event management api
|
||||
'south',
|
||||
|
||||
'crispy_forms', # better looking forms ( bootstrap )
|
||||
'sekizai', # for the addtoblock directive in templates
|
||||
'rest_framework', # for event management api
|
||||
|
||||
# Own Things
|
||||
'bootstrapTheme', # Theme
|
||||
'website', # Blechreiz Website in general
|
||||
'musicians', # User Management
|
||||
'eventplanner', # Event Management
|
||||
'eventplanner_gcal', # Event Management Sync with Google Calendar
|
||||
'simpleforum', # Messages ( Forum )
|
||||
'location_field', # custom location field used in Event Management
|
||||
'scoremanager', # manager of scores, repertoire etc.
|
||||
#'imagestore',
|
||||
#'sorl.thumbnail',
|
||||
#'tagging'
|
||||
'bootstrapTheme', # Theme
|
||||
'website', # Blechreiz Website in general
|
||||
'musicians', # User Management
|
||||
'eventplanner', # Event Management
|
||||
'eventplanner_gcal', # Event Management Sync with Google Calendar
|
||||
'simpleforum', # Messages ( Forum )
|
||||
'location_field', # custom location field used in Event Management
|
||||
'scoremanager', # manager of scores, repertoire etc.
|
||||
# 'imagestore',
|
||||
# 'sorl.thumbnail',
|
||||
# 'tagging'
|
||||
)
|
||||
|
||||
IMAGESTORE_TEMPLATE = "website/base.html"
|
||||
|
||||
|
||||
IMAGESTORE_TEMPLATE = "website/base.html"
|
||||
|
||||
REST_FRAMEWORK = {
|
||||
'DEFAULT_PERMISSION_CLASSES': ('rest_framework.permissions.IsAuthenticated',),
|
||||
'PAGINATE_BY': 10
|
||||
}
|
||||
|
||||
|
||||
GCAL_COUPLING = {
|
||||
'eventPrefix' : 'Blechreiz: ',
|
||||
'developerKey' : 'blechreiz-homepage',
|
||||
'clientId' : '34462582242-4kpdvvbi27ajt4u22uitqurpve9o8ipj.apps.googleusercontent.com',
|
||||
'client_secret' : 'y4t9XBrJdCODPTO5UvtONWWn',
|
||||
'credentials_file' : PROJECT_PATH + '/calendarCredentials.dat',
|
||||
'push_url' : "https://blechreiz.bauer.technology/eventplanner_gcal/gcalApiCallback",
|
||||
'eventPrefix': 'Blechreiz: ',
|
||||
'developerKey': 'blechreiz-homepage',
|
||||
'clientId': '34462582242-4kpdvvbi27ajt4u22uitqurpve9o8ipj.apps.googleusercontent.com',
|
||||
'client_secret': 'y4t9XBrJdCODPTO5UvtONWWn',
|
||||
'credentials_file': PROJECT_PATH + '/calendarCredentials.dat',
|
||||
'push_url': "https://blechreiz.bauer.technology/eventplanner_gcal/gcalApiCallback",
|
||||
}
|
||||
|
||||
|
||||
CRISPY_TEMPLATE_PACK = 'bootstrap'
|
||||
|
||||
# A sample logging configuration. The only tangible logging
|
||||
|
@ -198,6 +193,16 @@ CRISPY_TEMPLATE_PACK = 'bootstrap'
|
|||
LOGGING = {
|
||||
'version': 1,
|
||||
'disable_existing_loggers': False,
|
||||
'formatters': {
|
||||
'verbose': {
|
||||
'format': '{levelname} {asctime} {module} {message}',
|
||||
'style': '{',
|
||||
},
|
||||
'simple': {
|
||||
'format': '{levelname} {asctime} {message}',
|
||||
'style': '{',
|
||||
},
|
||||
},
|
||||
'handlers': {
|
||||
'file': {
|
||||
'level': 'DEBUG',
|
||||
|
@ -211,12 +216,13 @@ LOGGING = {
|
|||
'level': 'DEBUG',
|
||||
'propagate': True,
|
||||
},
|
||||
'eventplanner': {
|
||||
'eventplanner': {
|
||||
'handler': ['file'],
|
||||
'level': 'DEBUG',
|
||||
'propagate': True,
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
}
|
||||
|
||||
GOOGLE_MAPS_API_KEY = 'AIzaSyCf9Lm5ckjmVd08scTOd7fB1dC_UCoumKg'
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
from django.conf.urls import patterns, include, url
|
||||
from django.conf.urls import include, url
|
||||
|
||||
from django.contrib import admin
|
||||
|
||||
|
@ -6,26 +6,23 @@ import simpleforum.views
|
|||
|
||||
import eventplanner.urls
|
||||
import musicians.urls
|
||||
#import imagestore.urls
|
||||
import website.urls
|
||||
import scoremanager.urls
|
||||
import eventplanner_gcal.urls
|
||||
|
||||
|
||||
|
||||
import settings
|
||||
from . import settings
|
||||
from django.conf.urls.static import static
|
||||
|
||||
admin.autodiscover()
|
||||
|
||||
urlpatterns = patterns('',
|
||||
url(r'^', include( website.urls ) ),
|
||||
url(r'^events/', include( eventplanner.urls.urlpatterns) ),
|
||||
url(r'^musicians/', include( musicians.urls.urlpatterns) ),
|
||||
url(r'^scores/', include( scoremanager.urls.urlpatterns) ),
|
||||
url(r'^messages/$', simpleforum.views.message_view ),
|
||||
url(r'^admin/', include( admin.site.urls ) ),
|
||||
url(r'^location_field/', include( 'location_field.urls' ) ),
|
||||
url(r'^eventplanner_gcal/', include( eventplanner_gcal.urls) ),
|
||||
#url(r'^gallery/', include(imagestore.urls, namespace='imagestore') ),
|
||||
) + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
|
||||
urlpatterns = [
|
||||
url(r'^', include(website.urls)),
|
||||
url(r'^events/', include(eventplanner.urls.urlpatterns)),
|
||||
url(r'^musicians/', include(musicians.urls.urlpatterns)),
|
||||
url(r'^scores/', include(scoremanager.urls.urlpatterns)),
|
||||
url(r'^messages/$', simpleforum.views.message_view),
|
||||
url(r'^admin/', admin.site.urls),
|
||||
url(r'^location_field/', include('location_field.urls')),
|
||||
url(r'^eventplanner_gcal/', include(eventplanner_gcal.urls)),
|
||||
# url(r'^gallery/', include(imagestore.urls, namespace='imagestore') ),
|
||||
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
|
||||
|
|
|
@ -1,20 +1,20 @@
|
|||
from django.contrib import admin
|
||||
from eventplanner.models import Event, EventParticipation
|
||||
|
||||
|
||||
class EventParticipationInline(admin.TabularInline):
|
||||
model = EventParticipation
|
||||
extra = 1
|
||||
readonly_fields = ('user',)
|
||||
fields = ( 'user', 'status', 'comment', )
|
||||
has_add_permission = lambda self, req : False
|
||||
has_delete_permission = lambda self, req, obj : False
|
||||
|
||||
template = "eventplanner/admin_tabular.html"
|
||||
|
||||
|
||||
class EventAdmin(admin.ModelAdmin):
|
||||
inlines = ( EventParticipationInline, )
|
||||
|
||||
|
||||
admin.site.register( Event, EventAdmin )
|
||||
#from django.contrib import admin
|
||||
#from eventplanner.models import Event, EventParticipation
|
||||
#
|
||||
#
|
||||
#class EventParticipationInline(admin.TabularInline):
|
||||
# model = EventParticipation
|
||||
# extra = 1
|
||||
# readonly_fields = ('user',)
|
||||
# fields = ('user', 'status', 'comment',)
|
||||
# has_add_permission = lambda self, req: False
|
||||
# has_delete_permission = lambda self, req, obj: False
|
||||
#
|
||||
# template = "eventplanner/admin_tabular.html"
|
||||
#
|
||||
#
|
||||
#class EventAdmin(admin.ModelAdmin):
|
||||
# inlines = (EventParticipationInline,)
|
||||
#
|
||||
#
|
||||
#admin.site.register(Event, EventAdmin)
|
||||
|
|
|
@ -1,112 +0,0 @@
|
|||
# -*- coding: 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 'Event'
|
||||
db.create_table(u'eventplanner_event', (
|
||||
(u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
|
||||
('type', self.gf('django.db.models.fields.CharField')(default='Reh', max_length=6)),
|
||||
('short_desc', self.gf('django.db.models.fields.CharField')(max_length=100, null=True, blank=True)),
|
||||
('location', self.gf('django.db.models.fields.TextField')()),
|
||||
('map_location', self.gf('location_field.models.PlainLocationField')(max_length=63)),
|
||||
('desc', self.gf('django.db.models.fields.TextField')(blank=True)),
|
||||
('date', self.gf('django.db.models.fields.DateField')()),
|
||||
('time', self.gf('django.db.models.fields.TimeField')(null=True, blank=True)),
|
||||
('meeting_time', self.gf('django.db.models.fields.TimeField')(null=True, blank=True)),
|
||||
('end_date', self.gf('django.db.models.fields.DateField')(null=True)),
|
||||
))
|
||||
db.send_create_signal(u'eventplanner', ['Event'])
|
||||
|
||||
# Adding model 'EventParticipation'
|
||||
db.create_table(u'eventplanner_eventparticipation', (
|
||||
(u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
|
||||
('event', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['eventplanner.Event'])),
|
||||
('user', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['auth.User'])),
|
||||
('status', self.gf('django.db.models.fields.CharField')(default='?', max_length=3)),
|
||||
('comment', self.gf('django.db.models.fields.CharField')(max_length=64, blank=True)),
|
||||
))
|
||||
db.send_create_signal(u'eventplanner', ['EventParticipation'])
|
||||
|
||||
# Adding unique constraint on 'EventParticipation', fields ['event', 'user']
|
||||
db.create_unique(u'eventplanner_eventparticipation', ['event_id', 'user_id'])
|
||||
|
||||
|
||||
def backwards(self, orm):
|
||||
# Removing unique constraint on 'EventParticipation', fields ['event', 'user']
|
||||
db.delete_unique(u'eventplanner_eventparticipation', ['event_id', 'user_id'])
|
||||
|
||||
# Deleting model 'Event'
|
||||
db.delete_table(u'eventplanner_event')
|
||||
|
||||
# Deleting model 'EventParticipation'
|
||||
db.delete_table(u'eventplanner_eventparticipation')
|
||||
|
||||
|
||||
models = {
|
||||
u'auth.group': {
|
||||
'Meta': {'object_name': 'Group'},
|
||||
u'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': u"orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'})
|
||||
},
|
||||
u'auth.permission': {
|
||||
'Meta': {'ordering': "(u'content_type__app_label', u'content_type__model', u'codename')", 'unique_together': "((u'content_type', u'codename'),)", 'object_name': 'Permission'},
|
||||
'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
|
||||
'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['contenttypes.ContentType']"}),
|
||||
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
|
||||
'name': ('django.db.models.fields.CharField', [], {'max_length': '50'})
|
||||
},
|
||||
u'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': u"orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}),
|
||||
u'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': u"orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}),
|
||||
'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'})
|
||||
},
|
||||
u'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'}),
|
||||
u'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'})
|
||||
},
|
||||
u'eventplanner.event': {
|
||||
'Meta': {'object_name': 'Event'},
|
||||
'date': ('django.db.models.fields.DateField', [], {}),
|
||||
'desc': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
|
||||
'end_date': ('django.db.models.fields.DateField', [], {'null': 'True'}),
|
||||
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
|
||||
'location': ('django.db.models.fields.TextField', [], {}),
|
||||
'map_location': ('location_field.models.PlainLocationField', [], {'max_length': '63'}),
|
||||
'meeting_time': ('django.db.models.fields.TimeField', [], {'null': 'True', 'blank': 'True'}),
|
||||
'participants': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['auth.User']", 'through': u"orm['eventplanner.EventParticipation']", 'symmetrical': 'False'}),
|
||||
'short_desc': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}),
|
||||
'time': ('django.db.models.fields.TimeField', [], {'null': 'True', 'blank': 'True'}),
|
||||
'type': ('django.db.models.fields.CharField', [], {'default': "'Reh'", 'max_length': '6'})
|
||||
},
|
||||
u'eventplanner.eventparticipation': {
|
||||
'Meta': {'unique_together': "(('event', 'user'),)", 'object_name': 'EventParticipation'},
|
||||
'comment': ('django.db.models.fields.CharField', [], {'max_length': '64', 'blank': 'True'}),
|
||||
'event': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['eventplanner.Event']"}),
|
||||
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
|
||||
'status': ('django.db.models.fields.CharField', [], {'default': "'?'", 'max_length': '3'}),
|
||||
'user': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['auth.User']"})
|
||||
}
|
||||
}
|
||||
|
||||
complete_apps = ['eventplanner']
|
|
@ -1,191 +1,179 @@
|
|||
from django.db import models
|
||||
from django.utils.translation import ugettext as _
|
||||
from django.contrib.auth.models import User, Permission
|
||||
from django.db.models import Q
|
||||
|
||||
from datetime import datetime
|
||||
from location_field.models import PlainLocationField
|
||||
|
||||
from django.db.models import Q
|
||||
from django.dispatch import Signal
|
||||
|
||||
|
||||
|
||||
|
||||
class NoNextEventException( Exception ):
|
||||
class NoNextEventException(Exception):
|
||||
def __str__(self):
|
||||
return ("No event scheduled for the future")
|
||||
|
||||
|
||||
class Event ( models.Model ):
|
||||
|
||||
EVENT_TYPES = (
|
||||
( 'Reh', _('Rehearsal') ),
|
||||
( 'Conc', _('Concert') ),
|
||||
( 'Party', _('Party') ),
|
||||
( 'Travel', _('Travel') ),
|
||||
( 'Option', _('Option') ),
|
||||
)
|
||||
|
||||
type = models.CharField( max_length=6, choices=EVENT_TYPES, default='Reh', verbose_name= _("type") )
|
||||
short_desc = models.CharField( null=True, max_length=100, blank = True, verbose_name= _("Short Description") )
|
||||
location = models.TextField( blank=True, verbose_name=_("location") )
|
||||
map_location = PlainLocationField(blank=True, based_field = location, zoom=7, verbose_name=_("Location on map") )
|
||||
desc = models.TextField( blank=True, verbose_name=_("description") )
|
||||
|
||||
date = models.DateField( verbose_name= _("date") )
|
||||
time = models.TimeField( null=True, blank=True, verbose_name = _("time") )
|
||||
meeting_time = models.TimeField( null=True, blank=True, verbose_name = _("meeting_time") )
|
||||
|
||||
end_date = models.DateField( null=True, blank = True, verbose_name = _("End Date") )
|
||||
|
||||
participants = models.ManyToManyField( User, through='EventParticipation', verbose_name=_("participants") )
|
||||
|
||||
def __unicode__(self):
|
||||
return self.title
|
||||
return "No event scheduled for the future"
|
||||
|
||||
|
||||
class Event(models.Model):
|
||||
EVENT_TYPES = (
|
||||
('Reh', _('Rehearsal')),
|
||||
('Conc', _('Concert')),
|
||||
('Party', _('Party')),
|
||||
('Travel', _('Travel')),
|
||||
('Option', _('Option')),
|
||||
)
|
||||
|
||||
type = models.CharField(max_length=6, choices=EVENT_TYPES, default='Reh', verbose_name=_("type"))
|
||||
short_desc = models.CharField(null=True, max_length=100, blank=True, verbose_name=_("Short Description"))
|
||||
location = models.TextField(blank=True, verbose_name=_("location"))
|
||||
map_location = PlainLocationField(blank=True, based_field=location, zoom=7, verbose_name=_("Location on map"))
|
||||
desc = models.TextField(blank=True, verbose_name=_("description"))
|
||||
|
||||
date = models.DateField(verbose_name=_("date"))
|
||||
time = models.TimeField(null=True, blank=True, verbose_name=_("time"))
|
||||
meeting_time = models.TimeField(null=True, blank=True, verbose_name=_("meeting_time"))
|
||||
|
||||
end_date = models.DateField(null=True, blank=True, verbose_name=_("End Date"))
|
||||
|
||||
participants = models.ManyToManyField(User, through='EventParticipation', verbose_name=_("participants"))
|
||||
|
||||
def __unicode__(self):
|
||||
return self.title
|
||||
|
||||
def save(self, *args, **kwargs):
|
||||
# Call the "real" save() method
|
||||
super(Event, self).save(*args, **kwargs)
|
||||
|
||||
|
||||
# Create a "Don't Know" participation for each Musician
|
||||
for u in User.objects.all():
|
||||
for u in User.objects.all():
|
||||
if not u in self.participants.all():
|
||||
EventParticipation.objects.create( event=self, user = u, status='-', comment = '' )
|
||||
|
||||
EventParticipation.objects.create(event=self, user=u, status='-', comment='')
|
||||
|
||||
@property
|
||||
def title(self):
|
||||
res = self.get_type_display()
|
||||
if self.short_desc:
|
||||
res += " (" + self.short_desc + ") "
|
||||
|
||||
|
||||
return res
|
||||
|
||||
|
||||
@property
|
||||
def displaytime(self):
|
||||
if self.meeting_time is None or self.meeting_time == "":
|
||||
return self.time
|
||||
else:
|
||||
return self.meeting_time
|
||||
|
||||
return self.meeting_time
|
||||
|
||||
@property
|
||||
def displaydatetime(self):
|
||||
if not self.displaytime == None:
|
||||
return datetime.combine( self.date, self.displaytime )
|
||||
return datetime.combine(self.date, self.displaytime)
|
||||
else:
|
||||
return datetime.combine( self.date, datetime.min.time() )
|
||||
return datetime.combine(self.date, datetime.min.time())
|
||||
|
||||
@staticmethod
|
||||
def getNextEvent( eventType = "", includePreviousFromToday = True ):
|
||||
def getNextEvent(eventType="", includePreviousFromToday=True):
|
||||
"""Return the next event, of the given type. If type is the empty string the next event is returned
|
||||
regardless of its type.
|
||||
if includePreviousFromToday the nextEvent returned could also have been today with a startime < now """
|
||||
|
||||
|
||||
if includePreviousFromToday:
|
||||
if eventType == "":
|
||||
nextEvents = Event.objects.filter( date__gte = datetime.now() ).order_by('date')[:1]
|
||||
nextEvents = Event.objects.filter(date__gte=datetime.now()).order_by('date')[:1]
|
||||
else:
|
||||
nextEvents = Event.objects.filter( date__gte = datetime.now(), type = eventType ).order_by('date')[:1]
|
||||
|
||||
if len( nextEvents ) == 0:
|
||||
nextEvents = Event.objects.filter(date__gte=datetime.now(), type=eventType).order_by('date')[:1]
|
||||
|
||||
if len(nextEvents) == 0:
|
||||
raise NoNextEventException()
|
||||
|
||||
|
||||
return nextEvents[0]
|
||||
else:
|
||||
maximalNumberOfEventsOnSameDay = 4
|
||||
nextEvents = []
|
||||
if eventType =="":
|
||||
nextEvents = Event.objects.filter( date__gte = datetime.now() ).order_by('date')[:maximalNumberOfEventsOnSameDay]
|
||||
if eventType == "":
|
||||
nextEvents = Event.objects.filter(date__gte=datetime.now()).order_by('date')[
|
||||
:maximalNumberOfEventsOnSameDay]
|
||||
else:
|
||||
nextEvents = Event.objects.filter( date__gte = datetime.now(), type = eventType ).order_by('date')[:maximalNumberOfEventsOnSameDay]
|
||||
|
||||
nextEvents = Event.objects.filter(date__gte=datetime.now(), type=eventType).order_by('date')[
|
||||
:maximalNumberOfEventsOnSameDay]
|
||||
|
||||
if len(nextEvents) == 0:
|
||||
raise NoNextEventException()
|
||||
|
||||
|
||||
i = 0
|
||||
nextEvent = nextEvents[0]
|
||||
# nextEvent is not necessarily events[0] since events[0] may have been previously today
|
||||
while nextEvent.displaydatetime < datetime.now():
|
||||
if len(nextEvents ) <= i:
|
||||
if len(nextEvents) <= i:
|
||||
raise NoNextEventException()
|
||||
else:
|
||||
i += 1
|
||||
nextEvent = nextEvents[i]
|
||||
|
||||
|
||||
return nextEvent
|
||||
|
||||
|
||||
class EventParticipation(models.Model):
|
||||
OPTIONS = (('?', _('?')),
|
||||
('Yes', _('Yes')),
|
||||
('No', _('No')),
|
||||
('-', _('-'))
|
||||
)
|
||||
|
||||
class EventParticipation( models.Model ):
|
||||
OPTIONS = ( ('?' , _('?' )),
|
||||
('Yes', _('Yes')),
|
||||
('No' , _('No' )),
|
||||
('-' , _( '-' ))
|
||||
)
|
||||
|
||||
event = models.ForeignKey( Event, verbose_name=_("event") )
|
||||
user = models.ForeignKey( User, verbose_name=_("user") )
|
||||
status = models.CharField ( max_length=3, choices = OPTIONS, default='?', verbose_name=_("status") )
|
||||
comment = models.CharField ( max_length=64, blank=True, verbose_name=_("comment") )
|
||||
|
||||
event = models.ForeignKey(Event, verbose_name=_("event"), on_delete=models.PROTECT)
|
||||
user = models.ForeignKey(User, verbose_name=_("user"), on_delete=models.PROTECT)
|
||||
status = models.CharField(max_length=3, choices=OPTIONS, default='?', verbose_name=_("status"))
|
||||
comment = models.CharField(max_length=64, blank=True, verbose_name=_("comment"))
|
||||
|
||||
def get_username(self):
|
||||
return self.user.username
|
||||
|
||||
def save( self, *args, **kwargs ):
|
||||
prev = EventParticipation.objects.filter( event = self.event, user = self.user )
|
||||
|
||||
def save(self, *args, **kwargs):
|
||||
prev = EventParticipation.objects.filter(event=self.event, user=self.user)
|
||||
if len(prev) == 0:
|
||||
super(EventParticipation,self).save( *args,**kwargs)
|
||||
super(EventParticipation, self).save(*args, **kwargs)
|
||||
else:
|
||||
prev = prev[0]
|
||||
if prev.status != self.status or prev.comment != self.comment:
|
||||
super(EventParticipation,self).save( *args,**kwargs)
|
||||
|
||||
super(EventParticipation, self).save(*args, **kwargs)
|
||||
|
||||
@staticmethod
|
||||
def hasUserSetParticipationForAllEvents( user ):
|
||||
def hasUserSetParticipationForAllEvents(user):
|
||||
if not EventParticipation.isMember(user):
|
||||
return True
|
||||
|
||||
futurePart = EventParticipation.objects.filter( event__date__gte = datetime.now() )
|
||||
|
||||
notYetEntered = futurePart.filter( user = user ).filter( status = '-' )
|
||||
if len( notYetEntered ) > 0:
|
||||
futurePart = EventParticipation.objects.filter(event__date__gte=datetime.now())
|
||||
|
||||
notYetEntered = futurePart.filter(user=user).filter(status='-')
|
||||
if len(notYetEntered) > 0:
|
||||
return False
|
||||
else:
|
||||
return True
|
||||
|
||||
@staticmethod
|
||||
def isMember( user ):
|
||||
def isMember(user):
|
||||
return user.has_perm('eventplanner.member')
|
||||
|
||||
|
||||
@staticmethod
|
||||
def isAdmin( user ):
|
||||
def isAdmin(user):
|
||||
return user.has_perm('eventplanner.admin')
|
||||
|
||||
@staticmethod
|
||||
def members():
|
||||
perm = Permission.objects.get( codename='member' )
|
||||
f = User.objects.filter(Q(groups__permissions=perm) | Q(user_permissions=perm) ).distinct()
|
||||
perm = Permission.objects.get(codename='member')
|
||||
f = User.objects.filter(Q(groups__permissions=perm) | Q(user_permissions=perm)).distinct()
|
||||
return f.order_by('musician__position')
|
||||
|
||||
|
||||
|
||||
@staticmethod
|
||||
def get_or_create( user , event ):
|
||||
def get_or_create(user, event):
|
||||
try:
|
||||
result = EventParticipation.objects.get( event = event, user = user )
|
||||
result = EventParticipation.objects.get(event=event, user=user)
|
||||
except EventParticipation.DoesNotExist:
|
||||
result = EventParticipation.objects.create( event = event, user = user, status='-', comment = '' )
|
||||
|
||||
result = EventParticipation.objects.create(event=event, user=user, status='-', comment='')
|
||||
|
||||
return result
|
||||
|
||||
|
||||
class Meta:
|
||||
unique_together = ("event", "user")
|
||||
permissions = (
|
||||
("admin", _("Admin") ),
|
||||
("member", _("Member") ),
|
||||
("admin", _("Admin")),
|
||||
("member", _("Member")),
|
||||
)
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -1,14 +1,12 @@
|
|||
from rest_framework import serializers
|
||||
from models import EventParticipation
|
||||
|
||||
|
||||
from .models import EventParticipation, Event
|
||||
|
||||
|
||||
class ParticipationSerializer(serializers.ModelSerializer):
|
||||
event = serializers.PrimaryKeyRelatedField( many=False, read_only = False )
|
||||
user = serializers.Field( source='get_username' )
|
||||
status = serializers.CharField( source='status', required=False )
|
||||
|
||||
event = serializers.PrimaryKeyRelatedField(many=False, read_only=False, queryset=Event.objects.all())
|
||||
user = serializers.Field(source='get_username')
|
||||
status = serializers.CharField(source='status', required=False)
|
||||
|
||||
def get_identity(self, data):
|
||||
""" This hook is required for bulk update. """
|
||||
try:
|
||||
|
@ -19,6 +17,3 @@ class ParticipationSerializer(serializers.ModelSerializer):
|
|||
class Meta:
|
||||
model = EventParticipation
|
||||
fields = ('event', 'user', 'status', 'comment')
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -1,38 +1,36 @@
|
|||
|
||||
from datetime import datetime
|
||||
from models import Event, EventParticipation, NoNextEventException
|
||||
from .models import Event, EventParticipation, NoNextEventException
|
||||
from musicians.models import Musician
|
||||
|
||||
|
||||
|
||||
def addEventCountdownForNextEventToContext( context, username, eventType = "" ):
|
||||
def addEventCountdownForNextEventToContext(context, username, eventType=""):
|
||||
"""Returns an object that has to be added to the render context on the page where the countdown
|
||||
should be displayed . The username is required to also supply participation information."""
|
||||
|
||||
try:
|
||||
nextEvent = Event.getNextEvent( eventType, False )
|
||||
|
||||
try:
|
||||
nextEvent = Event.getNextEvent(eventType, False)
|
||||
except NoNextEventException:
|
||||
return
|
||||
|
||||
|
||||
countdown = dict()
|
||||
|
||||
if EventParticipation.isMember( username ):
|
||||
part = EventParticipation.objects.filter( user = username ).filter( event = nextEvent )
|
||||
if EventParticipation.isMember(username):
|
||||
part = EventParticipation.objects.filter(user=username).filter(event=nextEvent)
|
||||
countdown['participation'] = part[0].status
|
||||
|
||||
eventTime = nextEvent.displaydatetime
|
||||
countdown['event'] = nextEvent
|
||||
countdown['epoch'] = int( (eventTime - datetime.now() ).total_seconds() * 1000 )
|
||||
|
||||
countdown['epoch'] = int((eventTime - datetime.now()).total_seconds() * 1000)
|
||||
|
||||
context["countdown"] = countdown
|
||||
|
||||
|
||||
def addEventRouteForNextEventToContext( context, username, eventType = ""):
|
||||
def addEventRouteForNextEventToContext(context, username, eventType=""):
|
||||
"""Returns an object that has to be added to the render context on the page where the route
|
||||
should be displayed . The starting address of the route will be the home of the specified user"""
|
||||
|
||||
try:
|
||||
nextEvent = Event.getNextEvent( eventType, True )
|
||||
|
||||
try:
|
||||
nextEvent = Event.getNextEvent(eventType, True)
|
||||
except NoNextEventException:
|
||||
return
|
||||
|
||||
|
@ -40,16 +38,13 @@ def addEventRouteForNextEventToContext( context, username, eventType = ""):
|
|||
|
||||
routeInfo['event'] = nextEvent
|
||||
|
||||
musician = Musician.objects.get( user = username );
|
||||
routeInfo['origin'] = musician.street + ", " + str( musician.zip_code ) + " " + musician.city
|
||||
|
||||
musician = Musician.objects.get(user=username);
|
||||
routeInfo['origin'] = musician.street + ", " + str(musician.zip_code) + " " + musician.city
|
||||
|
||||
if nextEvent.map_location:
|
||||
# map_location has format "lat,longitute,zoomlevel"
|
||||
routeInfo['destination'] = ",".join( nextEvent.map_location.split(",")[:2] )
|
||||
routeInfo['destination'] = ",".join(nextEvent.map_location.split(",")[:2])
|
||||
else:
|
||||
routeInfo['destination'] = nextEvent.location
|
||||
|
||||
|
||||
|
||||
context["route"] = routeInfo
|
||||
|
||||
|
||||
|
|
|
@ -27,16 +27,16 @@
|
|||
<!-- Datepicker -->
|
||||
|
||||
|
||||
{% addtoblock "css" strip %}<link rel="stylesheet" href="{{STATIC_URL}}/css/datepicker.css" type="text/css" media="screen" /> {% endaddtoblock %}
|
||||
{% addtoblock "css" strip %}<link rel="stylesheet" href="{{STATIC_URL}}/css/timepicker.css" type="text/css" media="screen" /> {% endaddtoblock %}
|
||||
{% addtoblock "css" strip %}<link rel="stylesheet" href="{{STATIC_URL}}/css/jquery-ui-1.8.21.custom.css" type="text/css" media="screen" /> {% endaddtoblock %}
|
||||
{% addtoblock "css" strip %}<link rel="stylesheet" href="{{STATIC_URL}}/css/datepicker.css" type="text/css" media="screen" /> {% endaddtoblock %}
|
||||
{% addtoblock "css" strip %}<link rel="stylesheet" href="{{STATIC_URL}}/css/timepicker.css" type="text/css" media="screen" /> {% endaddtoblock %}
|
||||
{% addtoblock "css" strip %}<link rel="stylesheet" href="{{STATIC_URL}}/css/jquery-ui-1.8.21.custom.css" type="text/css" media="screen" /> {% endaddtoblock %}
|
||||
|
||||
|
||||
{% addtoblock "js" %}
|
||||
<script src="{{STATIC_URL}}/js/bootstrap-timepicker.js"></script>
|
||||
<script src="{{STATIC_URL}}/js/bootstrap-datepicker.js"></script>
|
||||
<script src="{{STATIC_URL}}/js/bootstrap-datepicker.de.js"></script>
|
||||
|
||||
<script src="{{STATIC_URL}}/js/jquery-ui-1.10.0.custom.min.js"></script>
|
||||
<script>
|
||||
|
||||
$(document).ready(function(){
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
{% if route %}
|
||||
|
||||
{% addtoblock "css" strip %}<link rel="stylesheet" href="{{STATIC_URL}}/css/concert_route.css" type="text/css" media="screen" />{% endaddtoblock %}
|
||||
{% addtoblock "js" strip %}<script type="text/javascript" src="//maps.google.com/maps/api/js?sensor=false&language=de"></script>{% endaddtoblock %}
|
||||
{% addtoblock "js" strip %}<script type="text/javascript" src="//maps.google.com/maps/api/js?key={GOOGLE_MAPS_API_KEY}&sensor=false&language=de"></script>{% endaddtoblock %}
|
||||
|
||||
|
||||
{% addtoblock "js" %}
|
||||
|
|
|
@ -1,18 +1,15 @@
|
|||
from django.conf.urls import patterns, url
|
||||
from django.conf.urls import url
|
||||
from django.contrib.auth.decorators import permission_required
|
||||
from eventplanner.views import events_grid, eventplanning, event_api, EventUpdate, EventCreate, deleteEvent
|
||||
|
||||
from eventplanner.views import events_grid, eventplanning,event_api,EventUpdate,EventCreate,deleteEvent
|
||||
|
||||
|
||||
urlpatterns = patterns('',
|
||||
url(r'^$', eventplanning ),
|
||||
url(r'^grid$', events_grid ),
|
||||
url(r'^planning$', eventplanning ),
|
||||
url(r'^(?P<pk>\d+)$', permission_required('eventplanner.change_event')( EventUpdate.as_view() ) ),
|
||||
url(r'^add$', permission_required('eventplanner.add_event' )( EventCreate.as_view() ) ),
|
||||
url(r'^(?P<pk>\d+)/delete$', permission_required('eventplanner.delete_event')( deleteEvent ) ),
|
||||
url(r'^api/', event_api, name="event_api" ),
|
||||
url(r'^api/(\w+)/$', event_api, name="event_api_per_user" ),
|
||||
url(r'^api/(\w+)/(\d+)$', event_api, name="event_api_per_user_event" ),
|
||||
)
|
||||
|
||||
urlpatterns = [
|
||||
url(r'^$', eventplanning),
|
||||
url(r'^grid$', events_grid),
|
||||
url(r'^planning$', eventplanning),
|
||||
url(r'^(?P<pk>\d+)$', permission_required('eventplanner.change_event')(EventUpdate.as_view())),
|
||||
url(r'^add$', permission_required('eventplanner.add_event')(EventCreate.as_view())),
|
||||
url(r'^(?P<pk>\d+)/delete$', permission_required('eventplanner.delete_event')(deleteEvent)),
|
||||
url(r'^api/', event_api, name="event_api"),
|
||||
url(r'^api/(\w+)/$', event_api, name="event_api_per_user"),
|
||||
url(r'^api/(\w+)/(\d+)$', event_api, name="event_api_per_user_event"),
|
||||
]
|
||||
|
|
|
@ -1,12 +1,11 @@
|
|||
|
||||
from django.shortcuts import render, redirect
|
||||
from django.http import HttpResponse
|
||||
from django.forms.models import ModelForm
|
||||
from django.forms import TextInput
|
||||
|
||||
from models import Event, EventParticipation
|
||||
from .models import Event, EventParticipation
|
||||
|
||||
from serializers import ParticipationSerializer
|
||||
from .serializers import ParticipationSerializer
|
||||
|
||||
import datetime
|
||||
|
||||
|
@ -14,7 +13,6 @@ from rest_framework.decorators import api_view
|
|||
from rest_framework.response import Response
|
||||
from rest_framework import status
|
||||
|
||||
|
||||
from crispy_forms.helper import FormHelper
|
||||
from crispy_forms.layout import Submit
|
||||
|
||||
|
@ -22,78 +20,75 @@ from crispy_forms.layout import Submit
|
|||
# ---------------------------------------- API ---------------------------------------------------------
|
||||
|
||||
|
||||
@api_view( ['GET', 'PUT'] )
|
||||
def event_api( request, username = None, eventId = None ):
|
||||
@api_view(['GET', 'PUT'])
|
||||
def event_api(request, username=None, eventId=None):
|
||||
try:
|
||||
participationQs = EventParticipation.objects.filter( event__date__gte = datetime.date.today() )
|
||||
participationQs = EventParticipation.objects.filter(event__date__gte=datetime.date.today())
|
||||
if username:
|
||||
participationQs = EventParticipation.objects.filter( user__username = username )
|
||||
participationQs = EventParticipation.objects.filter(user__username=username)
|
||||
if eventId:
|
||||
participationQs = participationQs.filter( event__pk = eventId )
|
||||
participationQs = participationQs.filter(event__pk=eventId)
|
||||
except EventParticipation.DoesNotExist:
|
||||
return HttpResponse( status=404 )
|
||||
|
||||
return HttpResponse(status=404)
|
||||
|
||||
if request.method == 'GET':
|
||||
serializer = ParticipationSerializer( participationQs )
|
||||
return Response( serializer.data )
|
||||
|
||||
elif request.method == 'PUT':
|
||||
serializer = ParticipationSerializer ( participationQs, data = request.DATA, many=True )
|
||||
if serializer.is_valid():
|
||||
for serializedObject in serializer.object:
|
||||
if not ( EventParticipation.isMember( request.user ) or EventParticipation.isAdmin( request.user ) ):
|
||||
return Response( status = status.HTTP_403_FORBIDDEN )
|
||||
if serializedObject.user != request.user:
|
||||
if not EventParticipation.isAdmin( request.user ):
|
||||
return Response( status = status.HTTP_403_FORBIDDEN )
|
||||
|
||||
serializer.save()
|
||||
return Response( serializer.data )
|
||||
else:
|
||||
return Response( status = status.HTTP_400_BAD_REQUEST )
|
||||
serializer = ParticipationSerializer(participationQs)
|
||||
return Response(serializer.data)
|
||||
|
||||
elif request.method == 'PUT':
|
||||
serializer = ParticipationSerializer(participationQs, data=request.DATA, many=True)
|
||||
if serializer.is_valid():
|
||||
for serializedObject in serializer.object:
|
||||
if not (EventParticipation.isMember(request.user) or EventParticipation.isAdmin(request.user)):
|
||||
return Response(status=status.HTTP_403_FORBIDDEN)
|
||||
if serializedObject.user != request.user:
|
||||
if not EventParticipation.isAdmin(request.user):
|
||||
return Response(status=status.HTTP_403_FORBIDDEN)
|
||||
|
||||
serializer.save()
|
||||
return Response(serializer.data)
|
||||
else:
|
||||
return Response(status=status.HTTP_400_BAD_REQUEST)
|
||||
|
||||
|
||||
# ------------------------------------ Normal Views ----------------------------------------------------
|
||||
|
||||
def eventplanning( request ):
|
||||
def eventplanning(request):
|
||||
"""
|
||||
View for a specific user, to edit his events
|
||||
"""
|
||||
# non-members see the grid - but cannot edit anything
|
||||
if not EventParticipation.isMember( request.user ):
|
||||
if not EventParticipation.isMember(request.user):
|
||||
return events_grid(request)
|
||||
|
||||
|
||||
# All events in the future sorted by date
|
||||
all_future_events = list ( Event.objects.filter( date__gte = datetime.date.today() ).order_by( 'date') )
|
||||
|
||||
for e in all_future_events:
|
||||
e.participation = EventParticipation.get_or_create( event = e, user = request.user )
|
||||
|
||||
context = { 'events' : all_future_events }
|
||||
return render ( request, 'eventplanner/eventplanning_view.html', context )
|
||||
|
||||
|
||||
|
||||
def events_grid( request ):
|
||||
usernames = [ u.username for u in EventParticipation.members() ]
|
||||
|
||||
all_future_events = list ( Event.objects.filter( date__gte = datetime.date.today() ).order_by( 'date') )
|
||||
all_future_events = list(Event.objects.filter(date__gte=datetime.date.today()).order_by('date'))
|
||||
|
||||
for e in all_future_events:
|
||||
e.participation = [ EventParticipation.get_or_create( event = e, user = u ) for u in EventParticipation.members() ]
|
||||
|
||||
context = { 'events': all_future_events,
|
||||
'usernames' : usernames }
|
||||
|
||||
return render ( request, 'eventplanner/events_grid.html', context )
|
||||
e.participation = EventParticipation.get_or_create(event=e, user=request.user)
|
||||
|
||||
context = {'events': all_future_events}
|
||||
return render(request, 'eventplanner/eventplanning_view.html', context)
|
||||
|
||||
|
||||
def events_grid(request):
|
||||
usernames = [u.username for u in EventParticipation.members()]
|
||||
|
||||
all_future_events = list(Event.objects.filter(date__gte=datetime.date.today()).order_by('date'))
|
||||
|
||||
for e in all_future_events:
|
||||
e.participation = [EventParticipation.get_or_create(event=e, user=u) for u in EventParticipation.members()]
|
||||
|
||||
context = {'events': all_future_events,
|
||||
'usernames': usernames}
|
||||
|
||||
return render(request, 'eventplanner/events_grid.html', context)
|
||||
|
||||
|
||||
def deleteEvent(request, pk):
|
||||
Event.objects.get(pk=pk).delete()
|
||||
return redirect(events_grid)
|
||||
|
||||
def deleteEvent( request, pk ):
|
||||
Event.objects.get( pk = pk ).delete()
|
||||
return redirect( events_grid )
|
||||
|
||||
# ------------------------------------ Detail Views ----------------------------------------------------
|
||||
|
||||
|
@ -102,7 +97,8 @@ from django.views.generic.edit import UpdateView, CreateView
|
|||
|
||||
from location_field.widgets import LocationWidget
|
||||
|
||||
class EventForm( ModelForm ):
|
||||
|
||||
class EventForm(ModelForm):
|
||||
def __init__(self, *args, **kwargs):
|
||||
self.helper = FormHelper()
|
||||
self.helper.form_class = 'form-horizontal'
|
||||
|
@ -111,38 +107,34 @@ class EventForm( ModelForm ):
|
|||
|
||||
class Meta:
|
||||
model = Event
|
||||
fields= [ 'type', 'short_desc', 'date', 'end_date', 'time', 'meeting_time', 'location', 'map_location', 'desc', ]
|
||||
|
||||
widgets = {
|
||||
'location' : TextInput(),
|
||||
'map_location' : LocationWidget(),
|
||||
}
|
||||
|
||||
fields = ['type', 'short_desc', 'date', 'end_date', 'time', 'meeting_time', 'location', 'map_location',
|
||||
'desc', ]
|
||||
|
||||
class EventUpdate( UpdateView ):
|
||||
widgets = {
|
||||
'location': TextInput(),
|
||||
'map_location': LocationWidget(),
|
||||
}
|
||||
|
||||
|
||||
class EventUpdate(UpdateView):
|
||||
form_class = EventForm
|
||||
model = Event
|
||||
model = Event
|
||||
template_name_suffix = "_update_form"
|
||||
success_url = '.'
|
||||
|
||||
|
||||
def get_context_data(self, **kwargs):
|
||||
context = super(UpdateView, self).get_context_data(**kwargs)
|
||||
context['viewtype'] = "update"
|
||||
return context
|
||||
|
||||
|
||||
class EventCreate( CreateView ):
|
||||
class EventCreate(CreateView):
|
||||
form_class = EventForm
|
||||
model = Event
|
||||
model = Event
|
||||
template_name_suffix = "_update_form"
|
||||
success_url = '.'
|
||||
|
||||
|
||||
def get_context_data(self, **kwargs):
|
||||
context = super(CreateView, self).get_context_data(**kwargs)
|
||||
context['viewtype'] = "create"
|
||||
return context
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -1,2 +0,0 @@
|
|||
import signals
|
||||
|
|
@ -3,45 +3,43 @@ import httplib2
|
|||
import datetime
|
||||
import time
|
||||
|
||||
from eventplanner.models import Event, EventParticipation
|
||||
from eventplanner_gcal.models import GCalMapping, GCalPushChannel,UserGCalCoupling
|
||||
from eventplanner.models import Event, EventParticipation
|
||||
from eventplanner_gcal.models import GCalMapping, GCalPushChannel, UserGCalCoupling
|
||||
from apiclient.http import BatchHttpRequest
|
||||
|
||||
from django.contrib.auth.models import User
|
||||
from django.conf import settings
|
||||
from pprint import pprint
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
# --------------------- Authentication using oauth2 --------------------------------------------
|
||||
|
||||
def createGCalServiceObject():
|
||||
"""Creates a Google API service object. This object is required whenever a Google API call is made"""
|
||||
from oauth2client.file import Storage
|
||||
from apiclient.discovery import build
|
||||
from oauth2client import tools, client
|
||||
|
||||
gcal_settings = settings.GCAL_COUPLING
|
||||
|
||||
storage = Storage( gcal_settings['credentials_file'] )
|
||||
storage = Storage(gcal_settings['credentials_file'])
|
||||
credentials = storage.get()
|
||||
|
||||
print("credentials", credentials)
|
||||
if credentials is None or credentials.invalid == True:
|
||||
#flow = client.flow_from_clientsecrets(CLIENT_SEICRET_FILE, SCOPES)
|
||||
|
||||
# flow = client.flow_from_clientsecrets(CLIENT_SEICRET_FILE, SCOPES)
|
||||
|
||||
print("invalid credentials for gcal")
|
||||
logger.error("Unable to initialize Google Calendar coupling. Check your settings!")
|
||||
return None
|
||||
|
||||
http = httplib2.Http()
|
||||
http = credentials.authorize( http )
|
||||
res = build( serviceName='calendar', version='v3',
|
||||
http=http, developerKey=gcal_settings['developerKey'] )
|
||||
http = credentials.authorize(http)
|
||||
res = build(serviceName='calendar', version='v3',
|
||||
http=http, developerKey=gcal_settings['developerKey'])
|
||||
|
||||
print("res", res)
|
||||
if res is None:
|
||||
logger.error( "Authentication at google API failed. Check your settings!" )
|
||||
logger.error("Authentication at google API failed. Check your settings!")
|
||||
return res
|
||||
|
||||
|
||||
|
@ -50,14 +48,15 @@ def getServiceObject():
|
|||
getServiceObject.__serviceObject = createGCalServiceObject()
|
||||
|
||||
return getServiceObject.__serviceObject
|
||||
getServiceObject.__serviceObject = None
|
||||
|
||||
|
||||
getServiceObject.__serviceObject = None
|
||||
|
||||
|
||||
# --------------------- Building GCal event representation ------------------------------------
|
||||
|
||||
|
||||
def buildGCalAttendeesObj( event ):
|
||||
def buildGCalAttendeesObj(event):
|
||||
"""Builds a attendees object that is inserted into the GCal event.
|
||||
Attendees are all users that have a google mail address. """
|
||||
result = []
|
||||
|
@ -66,9 +65,9 @@ def buildGCalAttendeesObj( event ):
|
|||
u = userMapping.user
|
||||
|
||||
# No get or create here, since a create would trigger another synchronization
|
||||
#participation = EventParticipation.get_or_create( u, event )
|
||||
# participation = EventParticipation.get_or_create( u, event )
|
||||
try:
|
||||
participation = EventParticipation.objects.get( event = event, user = u )
|
||||
participation = EventParticipation.objects.get(event=event, user=u)
|
||||
localStatus = participation.status
|
||||
localComment = participation.comment
|
||||
except EventParticipation.DoesNotExist:
|
||||
|
@ -76,9 +75,9 @@ def buildGCalAttendeesObj( event ):
|
|||
localComment = ""
|
||||
|
||||
status = "needsAction"
|
||||
if localStatus == "?" : status = "tentative"
|
||||
if localStatus == "?": status = "tentative"
|
||||
if localStatus == 'Yes': status = "accepted"
|
||||
if localStatus == 'No' : status = "declined"
|
||||
if localStatus == 'No': status = "declined"
|
||||
|
||||
o = {
|
||||
'id': userMapping.email,
|
||||
|
@ -87,20 +86,19 @@ def buildGCalAttendeesObj( event ):
|
|||
'comment': localComment,
|
||||
'responseStatus': status,
|
||||
}
|
||||
result.append( o )
|
||||
result.append(o)
|
||||
|
||||
return result
|
||||
|
||||
|
||||
|
||||
def buildGCalEvent( event, timezone="Europe/Berlin" ):
|
||||
def buildGCalEvent(event, timezone="Europe/Berlin"):
|
||||
""" Builds a GCal event using a local event. """
|
||||
|
||||
def createDateTimeObj( date, time ):
|
||||
def createDateTimeObj(date, time):
|
||||
if time is None:
|
||||
return { 'date': unicode(date), 'timeZone': timezone }
|
||||
return {'date': unicode(date), 'timeZone': timezone}
|
||||
else:
|
||||
return { 'dateTime': unicode(date) + 'T' + unicode(time) , 'timeZone': timezone }
|
||||
return {'dateTime': unicode(date) + 'T' + unicode(time), 'timeZone': timezone}
|
||||
|
||||
startDate = event.date
|
||||
endDate = event.end_date
|
||||
|
@ -112,47 +110,48 @@ def buildGCalEvent( event, timezone="Europe/Berlin" ):
|
|||
if startTime is None:
|
||||
endTime = None
|
||||
else:
|
||||
endTime = datetime.time( 22, 30 )
|
||||
endTime = datetime.time(22, 30)
|
||||
|
||||
gLocation = unicode(event.location)
|
||||
if event.map_location:
|
||||
# Map location has the following format: latitude,longitude,zoomlevel
|
||||
# the first two are needed
|
||||
s = event.map_location.split(",")
|
||||
gLocation = unicode ( "%s,%s" % (s[0],s[1] ) )
|
||||
gLocation = unicode("%s,%s" % (s[0], s[1]))
|
||||
|
||||
return {
|
||||
'summary': unicode(settings.GCAL_COUPLING['eventPrefix'] + event.title),
|
||||
'summary': unicode(settings.GCAL_COUPLING['eventPrefix'] + event.title),
|
||||
'description': unicode(event.desc),
|
||||
'location': gLocation,
|
||||
'start': createDateTimeObj( startDate, startTime ),
|
||||
'end' : createDateTimeObj( endDate, endTime ),
|
||||
'location': gLocation,
|
||||
'start': createDateTimeObj(startDate, startTime),
|
||||
'end': createDateTimeObj(endDate, endTime),
|
||||
'extendedProperties': {
|
||||
'private': {
|
||||
'blechreizEvent': 'true',
|
||||
'blechreizID': event.id,
|
||||
}
|
||||
},
|
||||
'attendees': buildGCalAttendeesObj( event ),
|
||||
'attendees': buildGCalAttendeesObj(event),
|
||||
}
|
||||
|
||||
|
||||
# ------------------------------ Callback Functions ------------------------------------------------
|
||||
|
||||
def onGcalEventCreated( request_id, response, exception=None ):
|
||||
def onGcalEventCreated(request_id, response, exception=None):
|
||||
"""Callback function for created events to enter new gcal id in the mapping table"""
|
||||
if exception is not None:
|
||||
print ( "response " + str( response ) )
|
||||
print("response " + str(response))
|
||||
raise exception
|
||||
|
||||
googleId = response['id']
|
||||
djangoId = response['extendedProperties']['private']['blechreizID']
|
||||
mapping = GCalMapping( gcal_id = googleId, event = Event.objects.get( pk=djangoId ) )
|
||||
mapping = GCalMapping(gcal_id=googleId, event=Event.objects.get(pk=djangoId))
|
||||
mapping.save()
|
||||
|
||||
|
||||
# ------------------------------ GCal Api Calls -------------------------------------------------
|
||||
|
||||
def getAllGCalEvents( service, fromNow=False ):
|
||||
def getAllGCalEvents(service, fromNow=False):
|
||||
"""Retrieves all gcal events with custom property blechreizEvent=True i.e. all
|
||||
events that have been created by this script."""
|
||||
|
||||
|
@ -170,99 +169,99 @@ def getAllGCalEvents( service, fromNow=False ):
|
|||
timeMin=minTime,
|
||||
timeMax='2100-01-01T00:00:00-00:00',
|
||||
privateExtendedProperty='blechreizEvent=true',
|
||||
).execute()
|
||||
).execute()
|
||||
return events['items']
|
||||
|
||||
def createGCalEvent( service, event, timezone="Europe/Berlin" ):
|
||||
|
||||
def createGCalEvent(service, event, timezone="Europe/Berlin"):
|
||||
"""Creates a new gcal event using a local event"""
|
||||
googleEvent = buildGCalEvent(event,timezone)
|
||||
return service.events().insert(calendarId='primary', body=googleEvent )
|
||||
googleEvent = buildGCalEvent(event, timezone)
|
||||
return service.events().insert(calendarId='primary', body=googleEvent)
|
||||
|
||||
def updateGCalEvent( service, event, timezone="Europe/Berlin"):
|
||||
|
||||
def updateGCalEvent(service, event, timezone="Europe/Berlin"):
|
||||
"""Updates an existing gcal event, using a local event"""
|
||||
googleEvent = buildGCalEvent(event,timezone)
|
||||
googleEvent = buildGCalEvent(event, timezone)
|
||||
try:
|
||||
mapping = GCalMapping.objects.get( event=event )
|
||||
mapping = GCalMapping.objects.get(event=event)
|
||||
except GCalMapping.DoesNotExist:
|
||||
return createGCalEvent( service, event, timezone )
|
||||
return createGCalEvent(service, event, timezone)
|
||||
|
||||
return service.events().patch(calendarId='primary', eventId= mapping.gcal_id, body=googleEvent)
|
||||
return service.events().patch(calendarId='primary', eventId=mapping.gcal_id, body=googleEvent)
|
||||
|
||||
def deleteGCalEvent( service, event ):
|
||||
|
||||
def deleteGCalEvent(service, event):
|
||||
"""Deletes gcal that belongs to the given local event"""
|
||||
mapping = GCalMapping.objects.get( event=event )
|
||||
mapping = GCalMapping.objects.get(event=event)
|
||||
gcalId = mapping.gcal_id
|
||||
mapping.delete()
|
||||
return service.events().delete(calendarId='primary', eventId=gcalId)
|
||||
|
||||
|
||||
|
||||
# ------------------------------------- Synchronization ----------------------------------------------------
|
||||
|
||||
def deleteAllGCalEvents( service = getServiceObject() ):
|
||||
def deleteAllGCalEvents(service=None):
|
||||
"""Deletes all gcal events that have been created by this script"""
|
||||
|
||||
if service is None: service = getServiceObject()
|
||||
if service is None:
|
||||
service = getServiceObject()
|
||||
|
||||
gcalIds = [ ev['id'] for ev in getAllGCalEvents( service ) ]
|
||||
l = len( gcalIds )
|
||||
gcalIds = [ev['id'] for ev in getAllGCalEvents(service)]
|
||||
l = len(gcalIds)
|
||||
if l == 0:
|
||||
return l
|
||||
|
||||
batch = BatchHttpRequest()
|
||||
for id in gcalIds:
|
||||
batch.add( service.events().delete(calendarId='primary', eventId=id) )
|
||||
batch.add(service.events().delete(calendarId='primary', eventId=id))
|
||||
batch.execute()
|
||||
|
||||
GCalMapping.objects.all().delete()
|
||||
|
||||
return l
|
||||
|
||||
def syncFromLocalToGoogle( service = None ):
|
||||
|
||||
def syncFromLocalToGoogle(service=None):
|
||||
""" Creates a google event for each local event (if it does not exist yet) and deletes all google events
|
||||
that are not found in local database. Updates participation info of gcal events using local data
|
||||
"""
|
||||
|
||||
|
||||
if service is None: service = getServiceObject()
|
||||
|
||||
allEvents = getAllGCalEvents( service )
|
||||
|
||||
allEvents = getAllGCalEvents(service)
|
||||
|
||||
eventsAtGoogle_djangoID = set()
|
||||
eventsAtGoogle_googleID = set()
|
||||
for gcalEv in allEvents:
|
||||
eventsAtGoogle_djangoID.add( int(gcalEv['extendedProperties']['private']['blechreizID'] ) )
|
||||
eventsAtGoogle_googleID.add( gcalEv['id'] )
|
||||
eventsAtGoogle_djangoID.add(int(gcalEv['extendedProperties']['private']['blechreizID']))
|
||||
eventsAtGoogle_googleID.add(gcalEv['id'])
|
||||
|
||||
localEvents_djangoID = set( Event. objects.all().values_list('pk' , flat=True) )
|
||||
localEvents_googleID = set( GCalMapping.objects.all().values_list('gcal_id', flat=True) )
|
||||
localEvents_djangoID = set(Event.objects.all().values_list('pk', flat=True))
|
||||
localEvents_googleID = set(GCalMapping.objects.all().values_list('gcal_id', flat=True))
|
||||
|
||||
eventsToCreate_djangoID = localEvents_djangoID - eventsAtGoogle_djangoID
|
||||
eventsToDelete_googleID = eventsAtGoogle_googleID - localEvents_googleID
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
batch = BatchHttpRequest()
|
||||
|
||||
batchIsEmpty = True
|
||||
for eventDjangoID in eventsToCreate_djangoID:
|
||||
batch.add( createGCalEvent( service, Event.objects.get( pk=eventDjangoID ) ), callback=onGcalEventCreated )
|
||||
batchIsEmpty=False
|
||||
batch.add(createGCalEvent(service, Event.objects.get(pk=eventDjangoID)), callback=onGcalEventCreated)
|
||||
batchIsEmpty = False
|
||||
|
||||
for eventGoogleID in eventsToDelete_googleID:
|
||||
batch.add( service.events().delete(calendarId='primary', eventId=eventGoogleID) )
|
||||
batchIsEmpty=False
|
||||
batch.add(service.events().delete(calendarId='primary', eventId=eventGoogleID))
|
||||
batchIsEmpty = False
|
||||
|
||||
for gcalEv in allEvents:
|
||||
eventDjangoID = int( gcalEv['extendedProperties']['private']['blechreizID'] )
|
||||
eventDjangoID = int(gcalEv['extendedProperties']['private']['blechreizID'])
|
||||
try:
|
||||
djangoEv = Event.objects.get( pk=eventDjangoID )
|
||||
if 'attendees' not in gcalEv:
|
||||
djangoEv = Event.objects.get(pk=eventDjangoID)
|
||||
if 'attendees' not in gcalEv:
|
||||
gcalEv['attendees'] = []
|
||||
|
||||
if gcalEv['attendees'] != buildGCalAttendeesObj( djangoEv ):
|
||||
batch.add( updateGCalEvent( service, djangoEv ) )
|
||||
if gcalEv['attendees'] != buildGCalAttendeesObj(djangoEv):
|
||||
batch.add(updateGCalEvent(service, djangoEv))
|
||||
batchIsEmpty = False
|
||||
except Event.DoesNotExist:
|
||||
pass
|
||||
|
@ -270,40 +269,38 @@ def syncFromLocalToGoogle( service = None ):
|
|||
if not batchIsEmpty:
|
||||
batch.execute()
|
||||
|
||||
return len(eventsToCreate_djangoID), len(eventsToDelete_googleID)
|
||||
|
||||
|
||||
return len (eventsToCreate_djangoID), len(eventsToDelete_googleID)
|
||||
|
||||
|
||||
|
||||
def syncFromGoogleToLocal( service = None ):
|
||||
def syncFromGoogleToLocal(service=None):
|
||||
"""Retrieves only participation infos for all events and updates local database if anything has changed. """
|
||||
|
||||
if service is None: service = getServiceObject()
|
||||
|
||||
if service is None:
|
||||
service = getServiceObject()
|
||||
|
||||
newStatusReceived = False
|
||||
allEvents = getAllGCalEvents( service, fromNow=True)
|
||||
allEvents = getAllGCalEvents(service, fromNow=True)
|
||||
for e in allEvents:
|
||||
localId = e['extendedProperties']['private']['blechreizID']
|
||||
localEvent = Event.objects.get( pk=localId )
|
||||
localId = e['extendedProperties']['private']['blechreizID']
|
||||
localEvent = Event.objects.get(pk=localId)
|
||||
for a in e['attendees']:
|
||||
user = UserGCalCoupling.objects.get( email = a['email'] ).user
|
||||
part = EventParticipation.get_or_create( user, localEvent )
|
||||
user = UserGCalCoupling.objects.get(email=a['email']).user
|
||||
part = EventParticipation.get_or_create(user, localEvent)
|
||||
if 'comment' in a:
|
||||
part.comment = a['comment']
|
||||
|
||||
if a['responseStatus'] == 'needsAction' :
|
||||
if a['responseStatus'] == 'needsAction':
|
||||
part.status = "-"
|
||||
elif a['responseStatus']=='tentative':
|
||||
elif a['responseStatus'] == 'tentative':
|
||||
part.status = '?'
|
||||
elif a['responseStatus'] == 'accepted':
|
||||
part.status = 'Yes'
|
||||
elif a['responseStatus'] == 'declined':
|
||||
part.status = 'No'
|
||||
else:
|
||||
logger.error("Unknown response status when mapping gcal event: " + a['responseStatus'] )
|
||||
logger.error("Unknown response status when mapping gcal event: " + a['responseStatus'])
|
||||
|
||||
prev = EventParticipation.objects.get( event = part.event, user = part.user )
|
||||
prev = EventParticipation.objects.get(event=part.event, user=part.user)
|
||||
|
||||
# Important: Save only if the participation info has changed
|
||||
# otherwise everything is synced back to google via the post save signal
|
||||
|
@ -315,18 +312,18 @@ def syncFromGoogleToLocal( service = None ):
|
|||
return newStatusReceived
|
||||
|
||||
|
||||
|
||||
# ------------------------------------- Synchronization ----------------------------------------------------
|
||||
|
||||
|
||||
def checkGCalSubscription( service=None, timeToLive = 14*24*3600, renewBeforeExpiry = None ):
|
||||
def checkGCalSubscription(service=None, timeToLive=14 * 24 * 3600, renewBeforeExpiry=None):
|
||||
"""Google offers a push service if any event information has changed. This works using a so called
|
||||
channel, which has a certain time to live. This method checks that a valid channel exists:
|
||||
- if none exists a new one is created
|
||||
- if existing channel does expire soon, the channel is renewed
|
||||
- if channel has already expired a sync is triggered and a new channel is created
|
||||
"""
|
||||
if service is None: service = getServiceObject()
|
||||
if service is None:
|
||||
service = getServiceObject()
|
||||
|
||||
if renewBeforeExpiry is None:
|
||||
renewBeforeExpiry = 0.8 * timeToLive
|
||||
|
@ -335,73 +332,75 @@ def checkGCalSubscription( service=None, timeToLive = 14*24*3600, renewBeforeEx
|
|||
|
||||
# Test if a channel already exists for this callbackURL
|
||||
try:
|
||||
dbChannel = GCalPushChannel.objects.get( address=callbackUrl )
|
||||
dbChannel = GCalPushChannel.objects.get(address=callbackUrl)
|
||||
gChannel = dbChannel.toGChannel()
|
||||
|
||||
# if expiration time between 0 and two days: stop and create new channel
|
||||
curTime = int( time.time() * 1000)
|
||||
curTime = int(time.time() * 1000)
|
||||
if gChannel.expiration > curTime:
|
||||
# not yet expired
|
||||
if curTime + renewBeforeExpiry*1000 > gChannel.expiration:
|
||||
#will expire in less than "renewBeforeExpiry"
|
||||
print ( "Renewing Google Calendar Subscription: " + callbackUrl )
|
||||
GCalPushChannel.stop( service, gChannel )
|
||||
GCalPushChannel.createNew( callbackUrl, service, timeToLive )
|
||||
if curTime + renewBeforeExpiry * 1000 > gChannel.expiration:
|
||||
# will expire in less than "renewBeforeExpiry"
|
||||
print("Renewing Google Calendar Subscription: " + callbackUrl)
|
||||
GCalPushChannel.stop(service, gChannel)
|
||||
GCalPushChannel.createNew(callbackUrl, service, timeToLive)
|
||||
else:
|
||||
print ("Channel active until %d " % ( gChannel.expiration, ) )
|
||||
print("Channel active until %d " % (gChannel.expiration,))
|
||||
else:
|
||||
logger.info( "Google calendar subscription had expired - getting new subscription" )
|
||||
logger.info("Google calendar subscription had expired - getting new subscription")
|
||||
# to get back in sync again we have to decide which data to take
|
||||
# so we use the local data as reference
|
||||
syncFromLocalToGoogle( service )
|
||||
GCalPushChannel.createNew( callbackUrl, service, timeToLive )
|
||||
syncFromLocalToGoogle(service)
|
||||
GCalPushChannel.createNew(callbackUrl, service, timeToLive)
|
||||
|
||||
except GCalPushChannel.DoesNotExist:
|
||||
# create new channel and save it in database
|
||||
logger.info ( "No CGalCallback Channel exists yet for: " + callbackUrl )
|
||||
logger.info("No CGalCallback Channel exists yet for: " + callbackUrl)
|
||||
# to get back in sync again we have to decide which data to take
|
||||
# so we use the local data as reference
|
||||
syncFromLocalToGoogle( service )
|
||||
GCalPushChannel.createNew( callbackUrl, service, timeToLive )
|
||||
syncFromLocalToGoogle(service)
|
||||
GCalPushChannel.createNew(callbackUrl, service, timeToLive)
|
||||
|
||||
|
||||
def stopAllGCalSubscriptions( service=None ):
|
||||
def stopAllGCalSubscriptions(service=None):
|
||||
"""Stops the channel subscription """
|
||||
|
||||
if service is None: service = getServiceObject()
|
||||
if service is None:
|
||||
service = getServiceObject()
|
||||
|
||||
for dbChannel in GCalPushChannel.objects.all():
|
||||
print("Stopping %s expiry at %d " % ( dbChannel.id, dbChannel.expiration ) )
|
||||
GCalPushChannel.stop( service, dbChannel.toGChannel() )
|
||||
print("Stopping %s expiry at %d " % (dbChannel.id, dbChannel.expiration))
|
||||
GCalPushChannel.stop(service, dbChannel.toGChannel())
|
||||
|
||||
|
||||
def checkIfGoogleCallbackIsValid( token, channelID, resourceID, service=None ):
|
||||
if service is None: service = getServiceObject()
|
||||
def checkIfGoogleCallbackIsValid(token, channelID, resourceID, service=None):
|
||||
if service is None:
|
||||
service = getServiceObject()
|
||||
|
||||
allChannels = GCalPushChannel.objects.all()
|
||||
if len(allChannels) == 0:
|
||||
return False # no known subscriptions -> callback has to be from an old channel
|
||||
return False # no known subscriptions -> callback has to be from an old channel
|
||||
|
||||
if len(allChannels) > 1:
|
||||
logger.warning( "Multiple GCal subscriptions! This is strange and probably an error. "
|
||||
"All channels are closed and one new is created. ")
|
||||
stopAllGCalSubscriptions( service )
|
||||
logger.warning("Multiple GCal subscriptions! This is strange and probably an error. "
|
||||
"All channels are closed and one new is created. ")
|
||||
stopAllGCalSubscriptions(service)
|
||||
checkGCalSubscription()
|
||||
allChannels = GCalPushChannel.objects.all()
|
||||
|
||||
assert( len(allChannels) == 1 )
|
||||
assert (len(allChannels) == 1)
|
||||
|
||||
theChannel = allChannels[0]
|
||||
|
||||
if channelID != theChannel.id or resourceID != theChannel.resource_id or token != theChannel.token:
|
||||
logger.warning( "Got GCal Response from an unexpected Channel"
|
||||
"Got (%s,%s,%s) "
|
||||
"expected (%s,%s,%s) "
|
||||
"Old Channel is stopped."
|
||||
% ( channelID, resourceID,token, theChannel.id, theChannel.resource_id, theChannel.token ))
|
||||
logger.warning("Got GCal Response from an unexpected Channel"
|
||||
"Got (%s,%s,%s) "
|
||||
"expected (%s,%s,%s) "
|
||||
"Old Channel is stopped."
|
||||
% (channelID, resourceID, token, theChannel.id, theChannel.resource_id, theChannel.token))
|
||||
|
||||
channelToStop = GCalPushChannel( id = channelID, resource_id = resourceID, token = token )
|
||||
GCalPushChannel.stop( service, channelToStop.toGChannel() )
|
||||
channelToStop = GCalPushChannel(id=channelID, resource_id=resourceID, token=token)
|
||||
GCalPushChannel.stop(service, channelToStop.toGChannel())
|
||||
|
||||
return False
|
||||
|
||||
|
|
|
@ -3,59 +3,57 @@ import uuid
|
|||
from eventplanner.models import Event
|
||||
from django.contrib.auth.models import User
|
||||
|
||||
|
||||
from apiclient.channel import Channel
|
||||
from django.db import models
|
||||
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class UserGCalCoupling( models.Model ):
|
||||
class UserGCalCoupling(models.Model):
|
||||
# For every user in this table the gcal coupling is activated
|
||||
user = models.OneToOneField( User )
|
||||
email = models.CharField( max_length=1024 )
|
||||
user = models.OneToOneField(User, on_delete=models.CASCADE)
|
||||
email = models.CharField(max_length=1024)
|
||||
|
||||
|
||||
class GCalMapping( models.Model ):
|
||||
class GCalMapping(models.Model):
|
||||
"""Mapping between event id at google and local event id"""
|
||||
gcal_id = models.CharField( max_length=64 )
|
||||
event = models.OneToOneField( Event, primary_key=True )
|
||||
gcal_id = models.CharField(max_length=64)
|
||||
event = models.OneToOneField(Event, primary_key=True, on_delete=models.CASCADE)
|
||||
|
||||
|
||||
class GCalPushChannel( models.Model ):
|
||||
class GCalPushChannel(models.Model):
|
||||
"""This table has either zero or one entry. Required to store if a channel already exists,
|
||||
when it expires and how to stop (renew) the channel
|
||||
"""
|
||||
|
||||
id = models.CharField( max_length=128, primary_key=True )
|
||||
address = models.CharField( max_length=256 )
|
||||
token = models.CharField( max_length=128 )
|
||||
resource_id = models.CharField( max_length=128 )
|
||||
expiration = models.IntegerField()
|
||||
id = models.CharField(max_length=128, primary_key=True)
|
||||
address = models.CharField(max_length=256)
|
||||
token = models.CharField(max_length=128)
|
||||
resource_id = models.CharField(max_length=128)
|
||||
expiration = models.IntegerField()
|
||||
|
||||
def toGChannel( self ):
|
||||
return Channel( 'web_hook', self.id, self.token, self.address, self.expiration, resource_id = self.resource_id )
|
||||
def toGChannel(self):
|
||||
return Channel('web_hook', self.id, self.token, self.address, self.expiration, resource_id=self.resource_id)
|
||||
|
||||
@staticmethod
|
||||
def fromGChannel( gChannel ):
|
||||
return GCalPushChannel( id = gChannel.id,
|
||||
address = gChannel.address,
|
||||
token = gChannel.token,
|
||||
expiration = gChannel.expiration,
|
||||
resource_id= gChannel.resource_id )
|
||||
def fromGChannel(gChannel):
|
||||
return GCalPushChannel(id=gChannel.id,
|
||||
address=gChannel.address,
|
||||
token=gChannel.token,
|
||||
expiration=gChannel.expiration,
|
||||
resource_id=gChannel.resource_id)
|
||||
|
||||
@staticmethod
|
||||
def createNew( callbackUrl, service, ttl = None ):
|
||||
gChannel = Channel('web_hook', str(uuid.uuid4()), 'blechreizGcal', callbackUrl, params= { 'ttl' : int(ttl) } )
|
||||
response = service.events().watch( calendarId='primary', body= gChannel.body() ).execute()
|
||||
gChannel.update( response )
|
||||
def createNew(callbackUrl, service, ttl=None):
|
||||
gChannel = Channel('web_hook', str(uuid.uuid4()), 'blechreizGcal', callbackUrl, params={'ttl': int(ttl)})
|
||||
response = service.events().watch(calendarId='primary', body=gChannel.body()).execute()
|
||||
gChannel.update(response)
|
||||
|
||||
dbChannel = GCalPushChannel.fromGChannel( gChannel )
|
||||
dbChannel = GCalPushChannel.fromGChannel(gChannel)
|
||||
dbChannel.save()
|
||||
|
||||
@staticmethod
|
||||
def stop( service, gChannel ):
|
||||
def stop(service, gChannel):
|
||||
channelService = service.channels()
|
||||
channelService.stop( body = gChannel.body() ).execute()
|
||||
GCalPushChannel.fromGChannel( gChannel ).delete()
|
||||
channelService.stop(body=gChannel.body()).execute()
|
||||
GCalPushChannel.fromGChannel(gChannel).delete()
|
||||
|
|
|
@ -1,54 +1,51 @@
|
|||
from django.db.models.signals import post_save,pre_delete
|
||||
from django.db.models.signals import post_save, pre_delete
|
||||
from django.dispatch import receiver
|
||||
from eventplanner.models import Event, EventParticipation
|
||||
from django.contrib.auth.models import User
|
||||
from eventplanner_gcal.google_sync import getServiceObject, syncFromLocalToGoogle,\
|
||||
createGCalEvent, deleteGCalEvent, updateGCalEvent, onGcalEventCreated
|
||||
from eventplanner_gcal.google_sync import getServiceObject, \
|
||||
createGCalEvent, deleteGCalEvent, updateGCalEvent, onGcalEventCreated
|
||||
|
||||
import logging
|
||||
logger = logging.getLogger( __name__ )
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
#@receiver( post_save, sender=User )
|
||||
#def user_changed( **kwargs ):
|
||||
# @receiver( post_save, sender=User )
|
||||
# def user_changed( **kwargs ):
|
||||
# logger.info("Synchronizing with google - user information changed")
|
||||
# syncFromLocalToGoogle( getServiceObject() )
|
||||
|
||||
|
||||
@receiver( post_save,sender= Event)
|
||||
def event_post_save_handler( **kwargs):
|
||||
@receiver(post_save, sender=Event)
|
||||
def event_post_save_handler(**kwargs):
|
||||
event = kwargs['instance']
|
||||
created = kwargs['created']
|
||||
try:
|
||||
if created:
|
||||
logger.info("Creating Gcal event")
|
||||
response = createGCalEvent( getServiceObject(), event ).execute()
|
||||
onGcalEventCreated( None, response, None )
|
||||
response = createGCalEvent(getServiceObject(), event).execute()
|
||||
onGcalEventCreated(None, response, None)
|
||||
else:
|
||||
logger.info( "Updating Gcal event")
|
||||
updateGCalEvent( getServiceObject(),event ).execute()
|
||||
logger.info("Updating Gcal event")
|
||||
updateGCalEvent(getServiceObject(), event).execute()
|
||||
except:
|
||||
logger.error( "Error updating Gcal event")
|
||||
logger.error("Error updating Gcal event")
|
||||
|
||||
|
||||
|
||||
|
||||
@receiver( pre_delete,sender= Event)
|
||||
def event_pre_delete_handler( **kwargs):
|
||||
@receiver(pre_delete, sender=Event)
|
||||
def event_pre_delete_handler(**kwargs):
|
||||
try:
|
||||
event = kwargs['instance']
|
||||
logger.info ("Deleting GCAL event")
|
||||
deleteGCalEvent( getServiceObject(), event ).execute()
|
||||
logger.info("Deleting GCAL event")
|
||||
deleteGCalEvent(getServiceObject(), event).execute()
|
||||
except:
|
||||
logger.error("Error deleting GCAL event")
|
||||
|
||||
|
||||
@receiver( post_save, sender=EventParticipation )
|
||||
def participation_post_save_handler( **kwargs):
|
||||
@receiver(post_save, sender=EventParticipation)
|
||||
def participation_post_save_handler(**kwargs):
|
||||
try:
|
||||
participation = kwargs['instance']
|
||||
logger.info("Participation post save -> update gcal")
|
||||
updateGCalEvent( getServiceObject(), participation.event ).execute()
|
||||
updateGCalEvent(getServiceObject(), participation.event).execute()
|
||||
except:
|
||||
logger.error("Error deleting GCAL event")
|
||||
|
||||
|
|
|
@ -1,10 +1,9 @@
|
|||
from django.conf.urls import patterns, url
|
||||
from django.conf.urls import url
|
||||
|
||||
from views import runSync, gcalApiCallback, manage
|
||||
|
||||
urlpatterns = patterns('',
|
||||
url(r'^runSync$', runSync ),
|
||||
url(r'^gcalApiCallback$', gcalApiCallback ),
|
||||
url(r'^manage$', manage ),
|
||||
)
|
||||
from .views import runSync, gcalApiCallback, manage
|
||||
|
||||
urlpatterns = [
|
||||
url(r'^runSync$', runSync),
|
||||
url(r'^gcalApiCallback$', gcalApiCallback),
|
||||
url(r'^manage$', manage),
|
||||
]
|
||||
|
|
|
@ -1,36 +0,0 @@
|
|||
from django.contrib import admin
|
||||
from imagestore.models import Image, Album, AlbumUpload
|
||||
from sorl.thumbnail.admin import 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)
|
|
@ -1,9 +0,0 @@
|
|||
# coding=utf-8
|
||||
from __future__ import unicode_literals
|
||||
import autocomplete_light
|
||||
from tagging.models import Tag
|
||||
|
||||
autocomplete_light.register(
|
||||
Tag,
|
||||
search_fields=['^name']
|
||||
)
|
|
@ -1,29 +0,0 @@
|
|||
#!/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
|
||||
|
||||
|
|
@ -1,42 +0,0 @@
|
|||
#!/usr/bin/env python
|
||||
# vim:fileencoding=utf-8
|
||||
try:
|
||||
import autocomplete_light
|
||||
AUTOCOMPLETE_LIGHT_INSTALLED = True
|
||||
except ImportError:
|
||||
AUTOCOMPLETE_LIGHT_INSTALLED = False
|
||||
|
||||
__author__ = 'zeus'
|
||||
|
||||
from django import forms
|
||||
from models import Image, Album
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
|
||||
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
|
||||
if AUTOCOMPLETE_LIGHT_INSTALLED:
|
||||
self.fields['tags'].widget = autocomplete_light.TextWidget('TagAutocomplete')
|
||||
|
||||
|
||||
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()
|
|
@ -1,5 +0,0 @@
|
|||
#!/usr/bin/env python
|
||||
# vim:fileencoding=utf-8
|
||||
|
||||
__author__ = 'zeus'
|
||||
|
|
@ -1,15 +0,0 @@
|
|||
#!/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
|
||||
|
|
@ -1,53 +0,0 @@
|
|||
#!/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)
|
|
@ -1,112 +0,0 @@
|
|||
# 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']
|
|
@ -1,121 +0,0 @@
|
|||
# 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']
|
|
@ -1,137 +0,0 @@
|
|||
# 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']
|
|
@ -1,135 +0,0 @@
|
|||
# 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']
|
|
@ -1,210 +0,0 @@
|
|||
# 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']
|
|
@ -1,21 +0,0 @@
|
|||
#!/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)
|
|
@ -1,11 +0,0 @@
|
|||
#!/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')),
|
||||
)
|
|
@ -1,276 +0,0 @@
|
|||
# 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: 2013-09-29 16:54+0200\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:22 models/bases/image.py:44
|
||||
msgid "Description"
|
||||
msgstr "Beschreibung"
|
||||
|
||||
#: views.py:63
|
||||
#, python-format
|
||||
msgid "No Tag found matching \"%s\"."
|
||||
msgstr "Kein Tag gefunden der auf \"%s\" passt."
|
||||
|
||||
#: imagestore_cms/cms_app.py:11
|
||||
msgid "Imagestore App"
|
||||
msgstr ""
|
||||
|
||||
#: imagestore_cms/cms_plugins.py:14 imagestore_cms/models.py:13
|
||||
#: imagestore_cms/models.py:16 models/album.py:14 models/bases/image.py:51
|
||||
#: templates/imagestore/image-scope.html:9 templates/imagestore/image.html:16
|
||||
msgid "Album"
|
||||
msgstr ""
|
||||
|
||||
#: imagestore_cms/cms_plugins.py:25
|
||||
msgid "Album as carousel"
|
||||
msgstr "Album als Karousel"
|
||||
|
||||
#: imagestore_cms/models.py:17
|
||||
msgid "Skin"
|
||||
msgstr "Skin"
|
||||
|
||||
#: imagestore_cms/models.py:18
|
||||
msgid "Image limit"
|
||||
msgstr "Bilder Limit"
|
||||
|
||||
#: imagestore_cms/models.py:19
|
||||
msgid "Thumbnail size"
|
||||
msgstr "Thumbnail Größe"
|
||||
|
||||
#: imagestore_cms/models.py:20
|
||||
msgid "Full size view"
|
||||
msgstr "Vollbild Ansicht"
|
||||
|
||||
#: imagestore_cms/models.py:21
|
||||
msgid "Template file"
|
||||
msgstr "Template File"
|
||||
|
||||
#: models/album.py:15
|
||||
msgid "Albums"
|
||||
msgstr "Alben"
|
||||
|
||||
#: models/image.py:13 templates/imagestore/image.html:8
|
||||
msgid "Image"
|
||||
msgstr "Bild"
|
||||
|
||||
#: models/image.py:14
|
||||
msgid "Images"
|
||||
msgstr "Bilder"
|
||||
|
||||
#: models/upload.py:84
|
||||
msgid "images file (.zip)"
|
||||
msgstr "Bild Datei (.zip)"
|
||||
|
||||
#: models/upload.py:85
|
||||
msgid "Select a .zip file of images to upload into a new Gallery."
|
||||
msgstr "Zip Datei mit Bilder auswählen um eine neue Gallerie zu erstellen."
|
||||
|
||||
#: models/upload.py:90
|
||||
msgid ""
|
||||
"Select an album to add these images to. leave this empty to create a new "
|
||||
"album from the supplied title."
|
||||
msgstr "Bitte Album für neue Bilder auswählen. Leer lassen um ein neues Album zu erstellen."
|
||||
|
||||
#: models/upload.py:95
|
||||
msgid "New album name"
|
||||
msgstr "Name für neues Album"
|
||||
|
||||
#: models/upload.py:96
|
||||
msgid ""
|
||||
"If not empty new album with this name will be created and images will be "
|
||||
"upload to this album"
|
||||
msgstr "Falls nicht leer wird ein Album mit diesem Namen erstellt, und hochgeladene Bilder werden in dieses Album hinzugefügt."
|
||||
|
||||
#: models/upload.py:98
|
||||
msgid "tags"
|
||||
msgstr "Tags"
|
||||
|
||||
#: models/upload.py:101
|
||||
msgid "Album upload"
|
||||
msgstr "Album upload"
|
||||
|
||||
#: models/upload.py:102
|
||||
msgid "Album uploads"
|
||||
msgstr "Album uploads"
|
||||
|
||||
#: models/bases/album.py:38 models/bases/image.py:48
|
||||
#: templates/imagestore/image-scope.html:4 templates/imagestore/image.html:13
|
||||
#: templates/imagestore/user_info.html:7
|
||||
msgid "User"
|
||||
msgstr "Benutzer"
|
||||
|
||||
#: models/bases/album.py:39
|
||||
msgid "Name"
|
||||
msgstr "Name"
|
||||
|
||||
#: models/bases/album.py:40 models/bases/image.py:49
|
||||
msgid "Created"
|
||||
msgstr "Erstellt"
|
||||
|
||||
#: models/bases/album.py:41 models/bases/image.py:50
|
||||
msgid "Updated"
|
||||
msgstr "Aktualisiert"
|
||||
|
||||
#: models/bases/album.py:42
|
||||
msgid "Is public"
|
||||
msgstr "Öffentlich"
|
||||
|
||||
#: models/bases/album.py:45 models/bases/image.py:46
|
||||
msgid "Order"
|
||||
msgstr "Reihenfolge"
|
||||
|
||||
#: models/bases/album.py:72 templates/imagestore/album_list.html:53
|
||||
msgid "Empty album"
|
||||
msgstr "Leeres Album"
|
||||
|
||||
#: models/bases/album.py:74
|
||||
msgid "Head"
|
||||
msgstr ""
|
||||
|
||||
#: models/bases/image.py:43
|
||||
msgid "Title"
|
||||
msgstr "Titel"
|
||||
|
||||
#: models/bases/image.py:45 templates/imagestore/image.html:77
|
||||
#: templates/imagestore/tag-cloud.html:7
|
||||
msgid "Tags"
|
||||
msgstr ""
|
||||
|
||||
#: models/bases/image.py:47
|
||||
msgid "File"
|
||||
msgstr "Datei"
|
||||
|
||||
#: models/bases/image.py:68
|
||||
msgid "Thumbnail"
|
||||
msgstr "Vorschau"
|
||||
|
||||
#: templates/imagestore/album_delete.html:6
|
||||
msgid "Are you sure that you would like to delete this album?"
|
||||
msgstr "Dieses Album wirklich löschen?"
|
||||
|
||||
#: 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 "Nein, zurück"
|
||||
|
||||
#: 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 "Ja"
|
||||
|
||||
#: 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 "Alle Alben"
|
||||
|
||||
#: templates/imagestore/album_list.html:60
|
||||
msgid "user"
|
||||
msgstr "Benutzer"
|
||||
|
||||
#: templates/imagestore/base.html:27
|
||||
msgid "Home"
|
||||
msgstr "Home"
|
||||
|
||||
#: templates/imagestore/base.html:30 templates/imagestore/tag.html:7
|
||||
msgid "Gallery"
|
||||
msgstr "Galerie"
|
||||
|
||||
#: templates/imagestore/base.html:46
|
||||
#: templates/imagestore/forms/image_form.html:7
|
||||
#: templates/imagestore/forms/image_form.html:11
|
||||
#: templates/imagestore/forms/image_form.html:15
|
||||
msgid "Upload image"
|
||||
msgstr "Bild hochladen"
|
||||
|
||||
#: templates/imagestore/base.html:49
|
||||
msgid "Create new album"
|
||||
msgstr "Neues Album erstellen"
|
||||
|
||||
#: templates/imagestore/image-list.html:14
|
||||
#: templates/imagestore/image_list.html:55
|
||||
msgid "Info"
|
||||
msgstr ""
|
||||
|
||||
#: templates/imagestore/image-scope.html:14 templates/imagestore/image.html:19
|
||||
#: templates/imagestore/tag.html:7 templates/imagestore/tag.html.py:11
|
||||
#: templates/imagestore/tag.html:15
|
||||
msgid "Tag"
|
||||
msgstr ""
|
||||
|
||||
#: templates/imagestore/image.html:56
|
||||
msgid "previous image"
|
||||
msgstr "Vorheriges Bild"
|
||||
|
||||
#: templates/imagestore/image.html:59
|
||||
msgid "next image"
|
||||
msgstr "Nächstes Bild"
|
||||
|
||||
#: templates/imagestore/image.html:69
|
||||
msgid "Edit info"
|
||||
msgstr "Info editieren"
|
||||
|
||||
#: templates/imagestore/image.html:70
|
||||
msgid "Delete image"
|
||||
msgstr "Bild löschen"
|
||||
|
||||
#: templates/imagestore/image.html:85
|
||||
msgid "Place"
|
||||
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 "Soll das Bild sicher gelöscht werden?"
|
||||
|
||||
#: templates/imagestore/image_list.html:34
|
||||
#: templates/imagestore/forms/album_form.html:13
|
||||
#: templates/imagestore/forms/album_form.html:23
|
||||
msgid "Edit album"
|
||||
msgstr "Album bearbeiten"
|
||||
|
||||
#: templates/imagestore/pagination.html:8
|
||||
msgid "previous page"
|
||||
msgstr "Vorherige Seite"
|
||||
|
||||
#: templates/imagestore/pagination.html:22
|
||||
msgid "next page"
|
||||
msgstr "Nächste Seite"
|
||||
|
||||
#: 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 "Neues album"
|
||||
|
||||
#: templates/imagestore/forms/album_form.html:31
|
||||
msgid "Save"
|
||||
msgstr "Speichern"
|
||||
|
||||
#: templates/imagestore/forms/image_form.html:19
|
||||
msgid "Upload"
|
||||
msgstr "Hochladen"
|
|
@ -1,78 +0,0 @@
|
|||
# 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']
|
|
@ -1,48 +0,0 @@
|
|||
# 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']
|
|
@ -1,85 +0,0 @@
|
|||
# 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']
|
|
@ -1,85 +0,0 @@
|
|||
# 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']
|
|
@ -1,98 +0,0 @@
|
|||
# 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']
|
|
@ -1,106 +0,0 @@
|
|||
# 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']
|
|
@ -1,131 +0,0 @@
|
|||
# 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']
|
|
@ -1,93 +0,0 @@
|
|||
# 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']
|
|
@ -1,89 +0,0 @@
|
|||
# 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']
|
|
@ -1,172 +0,0 @@
|
|||
# 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']
|
|
@ -1,98 +0,0 @@
|
|||
# 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']
|
|
@ -1,92 +0,0 @@
|
|||
# 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']
|
|
@ -1,92 +0,0 @@
|
|||
# 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']
|
|
@ -1,92 +0,0 @@
|
|||
# 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']
|
|
@ -1,5 +0,0 @@
|
|||
#!/usr/bin/env python
|
||||
# vim:fileencoding=utf-8
|
||||
|
||||
__author__ = 'zeus'
|
||||
|
|
@ -1,19 +0,0 @@
|
|||
#!/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
|
|
@ -1,16 +0,0 @@
|
|||
#!/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
|
||||
|
||||
class Album(BaseAlbum):
|
||||
|
||||
class Meta(BaseAlbum.Meta):
|
||||
abstract = False
|
||||
verbose_name = _('Album')
|
||||
verbose_name_plural = _('Albums')
|
||||
app_label = 'imagestore'
|
|
@ -1,5 +0,0 @@
|
|||
#!/usr/bin/env python
|
||||
# vim:fileencoding=utf-8
|
||||
|
||||
__author__ = 'zeus'
|
||||
|
|
@ -1,75 +0,0 @@
|
|||
#!/usr/bin/env python
|
||||
# vim:fileencoding=utf-8
|
||||
|
||||
__author__ = 'zeus'
|
||||
|
||||
|
||||
from django.db import models
|
||||
from django.db.models import permalink
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
from django.conf import settings
|
||||
from sorl.thumbnail import get_thumbnail
|
||||
|
||||
try:
|
||||
from django.contrib.auth import get_user_model
|
||||
User = get_user_model()
|
||||
except ImportError:
|
||||
from django.contrib.auth.models import User
|
||||
|
||||
try:
|
||||
import Image as PILImage
|
||||
except ImportError:
|
||||
from PIL import Image as PILImage
|
||||
|
||||
from imagestore.utils import 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, on_delete=models.SET_NULL)
|
||||
|
||||
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
|
|
@ -1,104 +0,0 @@
|
|||
#!/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 Permission
|
||||
from django.db.models.signals import post_save
|
||||
from django.contrib.contenttypes.models import ContentType
|
||||
from django.core.exceptions import ObjectDoesNotExist
|
||||
|
||||
try:
|
||||
from django.contrib.auth import get_user_model
|
||||
User = get_user_model()
|
||||
except ImportError:
|
||||
from django.contrib.auth.models import User
|
||||
|
||||
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 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)
|
|
@ -1,15 +0,0 @@
|
|||
#!/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'
|
|
@ -1,112 +0,0 @@
|
|||
#!/usr/bin/env python
|
||||
# vim:fileencoding=utf-8
|
||||
from django.core.exceptions import ImproperlyConfigured
|
||||
from django.utils.importlib import import_module
|
||||
|
||||
__author__ = 'zeus'
|
||||
|
||||
import os
|
||||
import zipfile
|
||||
from django.db import models
|
||||
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/')
|
||||
|
||||
|
||||
def process_zipfile(uploaded_album):
|
||||
if os.path.isfile(uploaded_album.zip_file.path):
|
||||
# TODO: implement try-except here
|
||||
zip = zipfile.ZipFile(uploaded_album.zip_file.path)
|
||||
bad_file = zip.testzip()
|
||||
if bad_file:
|
||||
raise Exception('"%s" in the .zip archive is corrupt.' % bad_file)
|
||||
|
||||
if not uploaded_album.album:
|
||||
uploaded_album.album = Album.objects.create(name=uploaded_album.new_album_name)
|
||||
|
||||
from cStringIO import StringIO
|
||||
for filename in sorted(zip.namelist()):
|
||||
if filename.startswith('__'): # do not process meta files
|
||||
continue
|
||||
print filename
|
||||
data = zip.read(filename)
|
||||
if len(data):
|
||||
try:
|
||||
# the following is taken from django.forms.fields.ImageField:
|
||||
# load() could spot a truncated JPEG, but it loads the entire
|
||||
# image in memory, which is a DoS vector. See #3848 and #18520.
|
||||
# verify() must be called immediately after the constructor.
|
||||
PILImage.open(StringIO(data)).verify()
|
||||
except Exception, ex:
|
||||
# if a "bad" file is found we just skip it.
|
||||
print('Error verify image: %s' % ex.message)
|
||||
continue
|
||||
if hasattr(data, 'seek') and callable(data.seek):
|
||||
print 'seeked'
|
||||
data.seek(0)
|
||||
try:
|
||||
img = Image(album=uploaded_album.album)
|
||||
img.image.save(filename, ContentFile(data))
|
||||
img.save()
|
||||
except Exception, ex:
|
||||
print('error create Image: %s' % ex.message)
|
||||
zip.close()
|
||||
uploaded_album.delete()
|
||||
|
||||
|
||||
upload_processor_function = getattr(settings, 'IMAGESTORE_UPLOAD_ALBUM_PROCESSOR', None)
|
||||
upload_processor = process_zipfile
|
||||
if upload_processor_function:
|
||||
i = upload_processor_function.rfind('.')
|
||||
module, attr = upload_processor_function[:i], upload_processor_function[i+1:]
|
||||
try:
|
||||
mod = import_module(module)
|
||||
except ImportError as e:
|
||||
raise ImproperlyConfigured('Error importing request processor module %s: "%s"' % (module, e))
|
||||
try:
|
||||
upload_processor = getattr(mod, attr)
|
||||
except AttributeError:
|
||||
raise ImproperlyConfigured('Module "%s" does not define a "%s" callable request processor' % (module, attr))
|
||||
|
||||
|
||||
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)
|
||||
upload_processor(self)
|
||||
|
||||
def delete(self, *args, **kwargs):
|
||||
storage, path = self.zip_file.storage, self.zip_file.path
|
||||
super(AlbumUpload, self).delete(*args, **kwargs)
|
||||
storage.delete(path)
|
|
@ -1,107 +0,0 @@
|
|||
#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;
|
||||
}
|
|
@ -1,30 +0,0 @@
|
|||
prettyPhoto v3.1.4
|
||||
© Copyright, Stephane Caron
|
||||
http://www.no-margin-for-errors.com
|
||||
|
||||
|
||||
============================= Released under =============================
|
||||
|
||||
Creative Commons 2.5
|
||||
http://creativecommons.org/licenses/by/2.5/
|
||||
|
||||
OR
|
||||
|
||||
GPLV2 license
|
||||
http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
You are free to use prettyPhoto in commercial projects as long as the
|
||||
copyright header is left intact.
|
||||
|
||||
============================ More information ============================
|
||||
http://www.no-margin-for-errors.com/projects/prettyPhoto/
|
||||
|
||||
|
||||
============================== Description ===============================
|
||||
|
||||
prettyPhoto is a jQuery based lightbox clone. Not only does it support images,
|
||||
it also add support for videos, flash, YouTube, iFrame. It's a full blown
|
||||
media modal box.
|
||||
|
||||
Please refer to http://www.no-margin-for-errors.com/projects/prettyPhoto/
|
||||
for all the details on how to use.
|
|
@ -1,170 +0,0 @@
|
|||
div.pp_default .pp_top,div.pp_default .pp_top .pp_middle,div.pp_default .pp_top .pp_left,div.pp_default .pp_top .pp_right,div.pp_default .pp_bottom,div.pp_default .pp_bottom .pp_left,div.pp_default .pp_bottom .pp_middle,div.pp_default .pp_bottom .pp_right{height:13px}
|
||||
div.pp_default .pp_top .pp_left{background:url(../images/prettyPhoto/default/sprite.png) -78px -93px no-repeat}
|
||||
div.pp_default .pp_top .pp_middle{background:url(../images/prettyPhoto/default/sprite_x.png) top left repeat-x}
|
||||
div.pp_default .pp_top .pp_right{background:url(../images/prettyPhoto/default/sprite.png) -112px -93px no-repeat}
|
||||
div.pp_default .pp_content .ppt{color:#f8f8f8}
|
||||
div.pp_default .pp_content_container .pp_left{background:url(../images/prettyPhoto/default/sprite_y.png) -7px 0 repeat-y;padding-left:13px}
|
||||
div.pp_default .pp_content_container .pp_right{background:url(../images/prettyPhoto/default/sprite_y.png) top right repeat-y;padding-right:13px}
|
||||
div.pp_default .pp_next:hover{background:url(../images/prettyPhoto/default/sprite_next.png) center right no-repeat;cursor:pointer}
|
||||
div.pp_default .pp_previous:hover{background:url(../images/prettyPhoto/default/sprite_prev.png) center left no-repeat;cursor:pointer}
|
||||
div.pp_default .pp_expand{background:url(../images/prettyPhoto/default/sprite.png) 0 -29px no-repeat;cursor:pointer;width:28px;height:28px}
|
||||
div.pp_default .pp_expand:hover{background:url(../images/prettyPhoto/default/sprite.png) 0 -56px no-repeat;cursor:pointer}
|
||||
div.pp_default .pp_contract{background:url(../images/prettyPhoto/default/sprite.png) 0 -84px no-repeat;cursor:pointer;width:28px;height:28px}
|
||||
div.pp_default .pp_contract:hover{background:url(../images/prettyPhoto/default/sprite.png) 0 -113px no-repeat;cursor:pointer}
|
||||
div.pp_default .pp_close{width:30px;height:30px;background:url(../images/prettyPhoto/default/sprite.png) 2px 1px no-repeat;cursor:pointer}
|
||||
div.pp_default .pp_gallery ul li a{background:url(../images/prettyPhoto/default/default_thumb.png) center center #f8f8f8;border:1px solid #aaa}
|
||||
div.pp_default .pp_social{margin-top:7px}
|
||||
div.pp_default .pp_gallery a.pp_arrow_previous,div.pp_default .pp_gallery a.pp_arrow_next{position:static;left:auto}
|
||||
div.pp_default .pp_nav .pp_play,div.pp_default .pp_nav .pp_pause{background:url(../images/prettyPhoto/default/sprite.png) -51px 1px no-repeat;height:30px;width:30px}
|
||||
div.pp_default .pp_nav .pp_pause{background-position:-51px -29px}
|
||||
div.pp_default a.pp_arrow_previous,div.pp_default a.pp_arrow_next{background:url(../images/prettyPhoto/default/sprite.png) -31px -3px no-repeat;height:20px;width:20px;margin:4px 0 0}
|
||||
div.pp_default a.pp_arrow_next{left:52px;background-position:-82px -3px}
|
||||
div.pp_default .pp_content_container .pp_details{margin-top:5px}
|
||||
div.pp_default .pp_nav{clear:none;height:30px;width:110px;position:relative}
|
||||
div.pp_default .pp_nav .currentTextHolder{font-family:Georgia;font-style:italic;color:#999;font-size:11px;left:75px;line-height:25px;position:absolute;top:2px;margin:0;padding:0 0 0 10px}
|
||||
div.pp_default .pp_close:hover,div.pp_default .pp_nav .pp_play:hover,div.pp_default .pp_nav .pp_pause:hover,div.pp_default .pp_arrow_next:hover,div.pp_default .pp_arrow_previous:hover{opacity:0.7}
|
||||
div.pp_default .pp_description{font-size:11px;font-weight:700;line-height:14px;margin:5px 50px 5px 0}
|
||||
div.pp_default .pp_bottom .pp_left{background:url(../images/prettyPhoto/default/sprite.png) -78px -127px no-repeat}
|
||||
div.pp_default .pp_bottom .pp_middle{background:url(../images/prettyPhoto/default/sprite_x.png) bottom left repeat-x}
|
||||
div.pp_default .pp_bottom .pp_right{background:url(../images/prettyPhoto/default/sprite.png) -112px -127px no-repeat}
|
||||
div.pp_default .pp_loaderIcon{background:url(../images/prettyPhoto/default/loader.gif) center center no-repeat}
|
||||
div.light_rounded .pp_top .pp_left{background:url(../images/prettyPhoto/light_rounded/sprite.png) -88px -53px no-repeat}
|
||||
div.light_rounded .pp_top .pp_right{background:url(../images/prettyPhoto/light_rounded/sprite.png) -110px -53px no-repeat}
|
||||
div.light_rounded .pp_next:hover{background:url(../images/prettyPhoto/light_rounded/btnNext.png) center right no-repeat;cursor:pointer}
|
||||
div.light_rounded .pp_previous:hover{background:url(../images/prettyPhoto/light_rounded/btnPrevious.png) center left no-repeat;cursor:pointer}
|
||||
div.light_rounded .pp_expand{background:url(../images/prettyPhoto/light_rounded/sprite.png) -31px -26px no-repeat;cursor:pointer}
|
||||
div.light_rounded .pp_expand:hover{background:url(../images/prettyPhoto/light_rounded/sprite.png) -31px -47px no-repeat;cursor:pointer}
|
||||
div.light_rounded .pp_contract{background:url(../images/prettyPhoto/light_rounded/sprite.png) 0 -26px no-repeat;cursor:pointer}
|
||||
div.light_rounded .pp_contract:hover{background:url(../images/prettyPhoto/light_rounded/sprite.png) 0 -47px no-repeat;cursor:pointer}
|
||||
div.light_rounded .pp_close{width:75px;height:22px;background:url(../images/prettyPhoto/light_rounded/sprite.png) -1px -1px no-repeat;cursor:pointer}
|
||||
div.light_rounded .pp_nav .pp_play{background:url(../images/prettyPhoto/light_rounded/sprite.png) -1px -100px no-repeat;height:15px;width:14px}
|
||||
div.light_rounded .pp_nav .pp_pause{background:url(../images/prettyPhoto/light_rounded/sprite.png) -24px -100px no-repeat;height:15px;width:14px}
|
||||
div.light_rounded .pp_arrow_previous{background:url(../images/prettyPhoto/light_rounded/sprite.png) 0 -71px no-repeat}
|
||||
div.light_rounded .pp_arrow_next{background:url(../images/prettyPhoto/light_rounded/sprite.png) -22px -71px no-repeat}
|
||||
div.light_rounded .pp_bottom .pp_left{background:url(../images/prettyPhoto/light_rounded/sprite.png) -88px -80px no-repeat}
|
||||
div.light_rounded .pp_bottom .pp_right{background:url(../images/prettyPhoto/light_rounded/sprite.png) -110px -80px no-repeat}
|
||||
div.dark_rounded .pp_top .pp_left{background:url(../images/prettyPhoto/dark_rounded/sprite.png) -88px -53px no-repeat}
|
||||
div.dark_rounded .pp_top .pp_right{background:url(../images/prettyPhoto/dark_rounded/sprite.png) -110px -53px no-repeat}
|
||||
div.dark_rounded .pp_content_container .pp_left{background:url(../images/prettyPhoto/dark_rounded/contentPattern.png) top left repeat-y}
|
||||
div.dark_rounded .pp_content_container .pp_right{background:url(../images/prettyPhoto/dark_rounded/contentPattern.png) top right repeat-y}
|
||||
div.dark_rounded .pp_next:hover{background:url(../images/prettyPhoto/dark_rounded/btnNext.png) center right no-repeat;cursor:pointer}
|
||||
div.dark_rounded .pp_previous:hover{background:url(../images/prettyPhoto/dark_rounded/btnPrevious.png) center left no-repeat;cursor:pointer}
|
||||
div.dark_rounded .pp_expand{background:url(../images/prettyPhoto/dark_rounded/sprite.png) -31px -26px no-repeat;cursor:pointer}
|
||||
div.dark_rounded .pp_expand:hover{background:url(../images/prettyPhoto/dark_rounded/sprite.png) -31px -47px no-repeat;cursor:pointer}
|
||||
div.dark_rounded .pp_contract{background:url(../images/prettyPhoto/dark_rounded/sprite.png) 0 -26px no-repeat;cursor:pointer}
|
||||
div.dark_rounded .pp_contract:hover{background:url(../images/prettyPhoto/dark_rounded/sprite.png) 0 -47px no-repeat;cursor:pointer}
|
||||
div.dark_rounded .pp_close{width:75px;height:22px;background:url(../images/prettyPhoto/dark_rounded/sprite.png) -1px -1px no-repeat;cursor:pointer}
|
||||
div.dark_rounded .pp_description{margin-right:85px;color:#fff}
|
||||
div.dark_rounded .pp_nav .pp_play{background:url(../images/prettyPhoto/dark_rounded/sprite.png) -1px -100px no-repeat;height:15px;width:14px}
|
||||
div.dark_rounded .pp_nav .pp_pause{background:url(../images/prettyPhoto/dark_rounded/sprite.png) -24px -100px no-repeat;height:15px;width:14px}
|
||||
div.dark_rounded .pp_arrow_previous{background:url(../images/prettyPhoto/dark_rounded/sprite.png) 0 -71px no-repeat}
|
||||
div.dark_rounded .pp_arrow_next{background:url(../images/prettyPhoto/dark_rounded/sprite.png) -22px -71px no-repeat}
|
||||
div.dark_rounded .pp_bottom .pp_left{background:url(../images/prettyPhoto/dark_rounded/sprite.png) -88px -80px no-repeat}
|
||||
div.dark_rounded .pp_bottom .pp_right{background:url(../images/prettyPhoto/dark_rounded/sprite.png) -110px -80px no-repeat}
|
||||
div.dark_rounded .pp_loaderIcon{background:url(../images/prettyPhoto/dark_rounded/loader.gif) center center no-repeat}
|
||||
div.dark_square .pp_left,div.dark_square .pp_middle,div.dark_square .pp_right,div.dark_square .pp_content{background:#000}
|
||||
div.dark_square .pp_description{color:#fff;margin:0 85px 0 0}
|
||||
div.dark_square .pp_loaderIcon{background:url(../images/prettyPhoto/dark_square/loader.gif) center center no-repeat}
|
||||
div.dark_square .pp_expand{background:url(../images/prettyPhoto/dark_square/sprite.png) -31px -26px no-repeat;cursor:pointer}
|
||||
div.dark_square .pp_expand:hover{background:url(../images/prettyPhoto/dark_square/sprite.png) -31px -47px no-repeat;cursor:pointer}
|
||||
div.dark_square .pp_contract{background:url(../images/prettyPhoto/dark_square/sprite.png) 0 -26px no-repeat;cursor:pointer}
|
||||
div.dark_square .pp_contract:hover{background:url(../images/prettyPhoto/dark_square/sprite.png) 0 -47px no-repeat;cursor:pointer}
|
||||
div.dark_square .pp_close{width:75px;height:22px;background:url(../images/prettyPhoto/dark_square/sprite.png) -1px -1px no-repeat;cursor:pointer}
|
||||
div.dark_square .pp_nav{clear:none}
|
||||
div.dark_square .pp_nav .pp_play{background:url(../images/prettyPhoto/dark_square/sprite.png) -1px -100px no-repeat;height:15px;width:14px}
|
||||
div.dark_square .pp_nav .pp_pause{background:url(../images/prettyPhoto/dark_square/sprite.png) -24px -100px no-repeat;height:15px;width:14px}
|
||||
div.dark_square .pp_arrow_previous{background:url(../images/prettyPhoto/dark_square/sprite.png) 0 -71px no-repeat}
|
||||
div.dark_square .pp_arrow_next{background:url(../images/prettyPhoto/dark_square/sprite.png) -22px -71px no-repeat}
|
||||
div.dark_square .pp_next:hover{background:url(../images/prettyPhoto/dark_square/btnNext.png) center right no-repeat;cursor:pointer}
|
||||
div.dark_square .pp_previous:hover{background:url(../images/prettyPhoto/dark_square/btnPrevious.png) center left no-repeat;cursor:pointer}
|
||||
div.light_square .pp_expand{background:url(../images/prettyPhoto/light_square/sprite.png) -31px -26px no-repeat;cursor:pointer}
|
||||
div.light_square .pp_expand:hover{background:url(../images/prettyPhoto/light_square/sprite.png) -31px -47px no-repeat;cursor:pointer}
|
||||
div.light_square .pp_contract{background:url(../images/prettyPhoto/light_square/sprite.png) 0 -26px no-repeat;cursor:pointer}
|
||||
div.light_square .pp_contract:hover{background:url(../images/prettyPhoto/light_square/sprite.png) 0 -47px no-repeat;cursor:pointer}
|
||||
div.light_square .pp_close{width:75px;height:22px;background:url(../images/prettyPhoto/light_square/sprite.png) -1px -1px no-repeat;cursor:pointer}
|
||||
div.light_square .pp_nav .pp_play{background:url(../images/prettyPhoto/light_square/sprite.png) -1px -100px no-repeat;height:15px;width:14px}
|
||||
div.light_square .pp_nav .pp_pause{background:url(../images/prettyPhoto/light_square/sprite.png) -24px -100px no-repeat;height:15px;width:14px}
|
||||
div.light_square .pp_arrow_previous{background:url(../images/prettyPhoto/light_square/sprite.png) 0 -71px no-repeat}
|
||||
div.light_square .pp_arrow_next{background:url(../images/prettyPhoto/light_square/sprite.png) -22px -71px no-repeat}
|
||||
div.light_square .pp_next:hover{background:url(../images/prettyPhoto/light_square/btnNext.png) center right no-repeat;cursor:pointer}
|
||||
div.light_square .pp_previous:hover{background:url(../images/prettyPhoto/light_square/btnPrevious.png) center left no-repeat;cursor:pointer}
|
||||
div.facebook .pp_top .pp_left{background:url(../images/prettyPhoto/facebook/sprite.png) -88px -53px no-repeat}
|
||||
div.facebook .pp_top .pp_middle{background:url(../images/prettyPhoto/facebook/contentPatternTop.png) top left repeat-x}
|
||||
div.facebook .pp_top .pp_right{background:url(../images/prettyPhoto/facebook/sprite.png) -110px -53px no-repeat}
|
||||
div.facebook .pp_content_container .pp_left{background:url(../images/prettyPhoto/facebook/contentPatternLeft.png) top left repeat-y}
|
||||
div.facebook .pp_content_container .pp_right{background:url(../images/prettyPhoto/facebook/contentPatternRight.png) top right repeat-y}
|
||||
div.facebook .pp_expand{background:url(../images/prettyPhoto/facebook/sprite.png) -31px -26px no-repeat;cursor:pointer}
|
||||
div.facebook .pp_expand:hover{background:url(../images/prettyPhoto/facebook/sprite.png) -31px -47px no-repeat;cursor:pointer}
|
||||
div.facebook .pp_contract{background:url(../images/prettyPhoto/facebook/sprite.png) 0 -26px no-repeat;cursor:pointer}
|
||||
div.facebook .pp_contract:hover{background:url(../images/prettyPhoto/facebook/sprite.png) 0 -47px no-repeat;cursor:pointer}
|
||||
div.facebook .pp_close{width:22px;height:22px;background:url(../images/prettyPhoto/facebook/sprite.png) -1px -1px no-repeat;cursor:pointer}
|
||||
div.facebook .pp_description{margin:0 37px 0 0}
|
||||
div.facebook .pp_loaderIcon{background:url(../images/prettyPhoto/facebook/loader.gif) center center no-repeat}
|
||||
div.facebook .pp_arrow_previous{background:url(../images/prettyPhoto/facebook/sprite.png) 0 -71px no-repeat;height:22px;margin-top:0;width:22px}
|
||||
div.facebook .pp_arrow_previous.disabled{background-position:0 -96px;cursor:default}
|
||||
div.facebook .pp_arrow_next{background:url(../images/prettyPhoto/facebook/sprite.png) -32px -71px no-repeat;height:22px;margin-top:0;width:22px}
|
||||
div.facebook .pp_arrow_next.disabled{background-position:-32px -96px;cursor:default}
|
||||
div.facebook .pp_nav{margin-top:0}
|
||||
div.facebook .pp_nav p{font-size:15px;padding:0 3px 0 4px}
|
||||
div.facebook .pp_nav .pp_play{background:url(../images/prettyPhoto/facebook/sprite.png) -1px -123px no-repeat;height:22px;width:22px}
|
||||
div.facebook .pp_nav .pp_pause{background:url(../images/prettyPhoto/facebook/sprite.png) -32px -123px no-repeat;height:22px;width:22px}
|
||||
div.facebook .pp_next:hover{background:url(../images/prettyPhoto/facebook/btnNext.png) center right no-repeat;cursor:pointer}
|
||||
div.facebook .pp_previous:hover{background:url(../images/prettyPhoto/facebook/btnPrevious.png) center left no-repeat;cursor:pointer}
|
||||
div.facebook .pp_bottom .pp_left{background:url(../images/prettyPhoto/facebook/sprite.png) -88px -80px no-repeat}
|
||||
div.facebook .pp_bottom .pp_middle{background:url(../images/prettyPhoto/facebook/contentPatternBottom.png) top left repeat-x}
|
||||
div.facebook .pp_bottom .pp_right{background:url(../images/prettyPhoto/facebook/sprite.png) -110px -80px no-repeat}
|
||||
div.pp_pic_holder a:focus{outline:none}
|
||||
div.pp_overlay{background:#000;display:none;left:0;position:absolute;top:0;width:100%;z-index:9500}
|
||||
div.pp_pic_holder{display:none;position:absolute;width:100px;z-index:10000}
|
||||
.pp_content{height:40px;min-width:40px}
|
||||
* html .pp_content{width:40px}
|
||||
.pp_content_container{position:relative;text-align:left;width:100%}
|
||||
.pp_content_container .pp_left{padding-left:20px}
|
||||
.pp_content_container .pp_right{padding-right:20px}
|
||||
.pp_content_container .pp_details{float:left;margin:10px 0 2px}
|
||||
.pp_description{display:none;margin:0}
|
||||
.pp_social{float:left;margin:0}
|
||||
.pp_social .facebook{float:left;margin-left:5px;width:55px;overflow:hidden}
|
||||
.pp_social .twitter{float:left}
|
||||
.pp_nav{clear:right;float:left;margin:3px 10px 0 0}
|
||||
.pp_nav p{float:left;white-space:nowrap;margin:2px 4px}
|
||||
.pp_nav .pp_play,.pp_nav .pp_pause{float:left;margin-right:4px;text-indent:-10000px}
|
||||
a.pp_arrow_previous,a.pp_arrow_next{display:block;float:left;height:15px;margin-top:3px;overflow:hidden;text-indent:-10000px;width:14px}
|
||||
.pp_hoverContainer{position:absolute;top:0;width:100%;z-index:2000}
|
||||
.pp_gallery{display:none;left:50%;margin-top:-50px;position:absolute;z-index:10000}
|
||||
.pp_gallery div{float:left;overflow:hidden;position:relative}
|
||||
.pp_gallery ul{float:left;height:35px;position:relative;white-space:nowrap;margin:0 0 0 5px;padding:0}
|
||||
.pp_gallery ul a{border:1px rgba(0,0,0,0.5) solid;display:block;float:left;height:33px;overflow:hidden}
|
||||
.pp_gallery ul a img{border:0}
|
||||
.pp_gallery li{display:block;float:left;margin:0 5px 0 0;padding:0}
|
||||
.pp_gallery li.default a{background:url(../images/prettyPhoto/facebook/default_thumbnail.gif) 0 0 no-repeat;display:block;height:33px;width:50px}
|
||||
.pp_gallery .pp_arrow_previous,.pp_gallery .pp_arrow_next{margin-top:7px!important}
|
||||
a.pp_next{background:url(../images/prettyPhoto/light_rounded/btnNext.png) 10000px 10000px no-repeat;display:block;float:right;height:100%;text-indent:-10000px;width:49%}
|
||||
a.pp_previous{background:url(../images/prettyPhoto/light_rounded/btnNext.png) 10000px 10000px no-repeat;display:block;float:left;height:100%;text-indent:-10000px;width:49%}
|
||||
a.pp_expand,a.pp_contract{cursor:pointer;display:none;height:20px;position:absolute;right:30px;text-indent:-10000px;top:10px;width:20px;z-index:20000}
|
||||
a.pp_close{position:absolute;right:0;top:0;display:block;line-height:22px;text-indent:-10000px}
|
||||
.pp_loaderIcon{display:block;height:24px;left:50%;position:absolute;top:50%;width:24px;margin:-12px 0 0 -12px}
|
||||
#pp_full_res{line-height:1!important}
|
||||
#pp_full_res .pp_inline{text-align:left}
|
||||
#pp_full_res .pp_inline p{margin:0 0 15px}
|
||||
div.ppt{color:#fff;display:none;font-size:17px;z-index:9999;margin:0 0 5px 15px}
|
||||
div.pp_default .pp_content,div.light_rounded .pp_content{background-color:#fff}
|
||||
div.pp_default #pp_full_res .pp_inline,div.light_rounded .pp_content .ppt,div.light_rounded #pp_full_res .pp_inline,div.light_square .pp_content .ppt,div.light_square #pp_full_res .pp_inline,div.facebook .pp_content .ppt,div.facebook #pp_full_res .pp_inline{color:#000}
|
||||
div.pp_default .pp_gallery ul li a:hover,div.pp_default .pp_gallery ul li.selected a,.pp_gallery ul a:hover,.pp_gallery li.selected a{border-color:#fff}
|
||||
div.pp_default .pp_details,div.light_rounded .pp_details,div.dark_rounded .pp_details,div.dark_square .pp_details,div.light_square .pp_details,div.facebook .pp_details{position:relative}
|
||||
div.light_rounded .pp_top .pp_middle,div.light_rounded .pp_content_container .pp_left,div.light_rounded .pp_content_container .pp_right,div.light_rounded .pp_bottom .pp_middle,div.light_square .pp_left,div.light_square .pp_middle,div.light_square .pp_right,div.light_square .pp_content,div.facebook .pp_content{background:#fff}
|
||||
div.light_rounded .pp_description,div.light_square .pp_description{margin-right:85px}
|
||||
div.light_rounded .pp_gallery a.pp_arrow_previous,div.light_rounded .pp_gallery a.pp_arrow_next,div.dark_rounded .pp_gallery a.pp_arrow_previous,div.dark_rounded .pp_gallery a.pp_arrow_next,div.dark_square .pp_gallery a.pp_arrow_previous,div.dark_square .pp_gallery a.pp_arrow_next,div.light_square .pp_gallery a.pp_arrow_previous,div.light_square .pp_gallery a.pp_arrow_next{margin-top:12px!important}
|
||||
div.light_rounded .pp_arrow_previous.disabled,div.dark_rounded .pp_arrow_previous.disabled,div.dark_square .pp_arrow_previous.disabled,div.light_square .pp_arrow_previous.disabled{background-position:0 -87px;cursor:default}
|
||||
div.light_rounded .pp_arrow_next.disabled,div.dark_rounded .pp_arrow_next.disabled,div.dark_square .pp_arrow_next.disabled,div.light_square .pp_arrow_next.disabled{background-position:-22px -87px;cursor:default}
|
||||
div.light_rounded .pp_loaderIcon,div.light_square .pp_loaderIcon{background:url(../images/prettyPhoto/light_rounded/loader.gif) center center no-repeat}
|
||||
div.dark_rounded .pp_top .pp_middle,div.dark_rounded .pp_content,div.dark_rounded .pp_bottom .pp_middle{background:url(../images/prettyPhoto/dark_rounded/contentPattern.png) top left repeat}
|
||||
div.dark_rounded .currentTextHolder,div.dark_square .currentTextHolder{color:#c4c4c4}
|
||||
div.dark_rounded #pp_full_res .pp_inline,div.dark_square #pp_full_res .pp_inline{color:#fff}
|
||||
.pp_top,.pp_bottom{height:20px;position:relative}
|
||||
* html .pp_top,* html .pp_bottom{padding:0 20px}
|
||||
.pp_top .pp_left,.pp_bottom .pp_left{height:20px;left:0;position:absolute;width:20px}
|
||||
.pp_top .pp_middle,.pp_bottom .pp_middle{height:20px;left:20px;position:absolute;right:20px}
|
||||
* html .pp_top .pp_middle,* html .pp_bottom .pp_middle{left:0;position:static}
|
||||
.pp_top .pp_right,.pp_bottom .pp_right{height:20px;left:auto;position:absolute;right:0;top:0;width:20px}
|
||||
.pp_fade,.pp_gallery li.default a img{display:none}
|
Before Width: | Height: | Size: 60 KiB |
Before Width: | Height: | Size: 82 KiB |
Before Width: | Height: | Size: 35 KiB |
Before Width: | Height: | Size: 96 KiB |
Before Width: | Height: | Size: 43 KiB |
Before Width: | Height: | Size: 940 KiB |
Before Width: | Height: | Size: 4.0 KiB |
Before Width: | Height: | Size: 6.8 KiB |
Before Width: | Height: | Size: 4.0 KiB |
Before Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 130 B |
Before Width: | Height: | Size: 227 B |
Before Width: | Height: | Size: 2.5 KiB |
Before Width: | Height: | Size: 4.0 KiB |
Before Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 121 B |
Before Width: | Height: | Size: 227 B |
Before Width: | Height: | Size: 2.5 KiB |
Before Width: | Height: | Size: 3.4 KiB |
Before Width: | Height: | Size: 1.5 KiB |
Before Width: | Height: | Size: 6.2 KiB |
Before Width: | Height: | Size: 6.5 KiB |
Before Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 845 B |
Before Width: | Height: | Size: 828 B |
Before Width: | Height: | Size: 142 B |
Before Width: | Height: | Size: 137 B |
Before Width: | Height: | Size: 136 B |
Before Width: | Height: | Size: 142 B |
Before Width: | Height: | Size: 227 B |
Before Width: | Height: | Size: 2.5 KiB |
Before Width: | Height: | Size: 4.1 KiB |
Before Width: | Height: | Size: 1.4 KiB |