fnp
/
redakcja.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
e5ba4e0
)
remove USE_CELERY setting,
author
Radek Czajka
<radoslaw.czajka@nowoczesnapolska.org.pl>
Fri, 28 Oct 2011 15:26:02 +0000
(17:26 +0200)
committer
Radek Czajka
<radoslaw.czajka@nowoczesnapolska.org.pl>
Fri, 28 Oct 2011 15:26:02 +0000
(17:26 +0200)
some chunk form fixes
apps/catalogue/forms.py
patch
|
blob
|
history
apps/catalogue/models/__init__.py
patch
|
blob
|
history
apps/catalogue/models/chunk.py
patch
|
blob
|
history
apps/catalogue/tasks.py
patch
|
blob
|
history
apps/catalogue/views.py
patch
|
blob
|
history
redakcja/localsettings.sample
patch
|
blob
|
history
redakcja/static/css/filelist.css
patch
|
blob
|
history
diff --git
a/apps/catalogue/forms.py
b/apps/catalogue/forms.py
index
ad1e4d6
..
4e5b2cb
100644
(file)
--- a/
apps/catalogue/forms.py
+++ b/
apps/catalogue/forms.py
@@
-3,7
+3,7
@@
# This file is part of FNP-Redakcja, licensed under GNU Affero GPLv3 or later.
# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information.
#
# This file is part of FNP-Redakcja, licensed under GNU Affero GPLv3 or later.
# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information.
#
-from
django.contrib.auth
.models import User
+from
catalogue
.models import User
from django.db.models import Count
from django import forms
from django.utils.translation import ugettext_lazy as _
from django.db.models import Count
from django import forms
from django.utils.translation import ugettext_lazy as _
@@
-77,11
+77,12
@@
class ChunkForm(forms.ModelForm):
class Meta:
model = Chunk
class Meta:
model = Chunk
- fields = ['title', 'slug', 'user', 'stage']
+ fields = ['title', 'slug', '
gallery_start', '
user', 'stage']
exclude = ['number']
def __init__(self, *args, **kwargs):
super(ChunkForm, self).__init__(*args, **kwargs)
exclude = ['number']
def __init__(self, *args, **kwargs):
super(ChunkForm, self).__init__(*args, **kwargs)
+ self.fields['gallery_start'].widget.attrs={'class': 'number-input'}
self.fields['slug'].widget.attrs={'class': 'autoslug'}
self.fields['title'].widget.attrs={'class': 'autoslug-source'}
self.fields['slug'].widget.attrs={'class': 'autoslug'}
self.fields['title'].widget.attrs={'class': 'autoslug-source'}
diff --git
a/apps/catalogue/models/__init__.py
b/apps/catalogue/models/__init__.py
index
d9a11dd
..
6161807
100755
(executable)
--- a/
apps/catalogue/models/__init__.py
+++ b/
apps/catalogue/models/__init__.py
@@
-7,3
+7,12
@@
from catalogue.models.chunk import Chunk
from catalogue.models.publish_log import BookPublishRecord, ChunkPublishRecord
from catalogue.models.book import Book
from catalogue.models.listeners import *
from catalogue.models.publish_log import BookPublishRecord, ChunkPublishRecord
from catalogue.models.book import Book
from catalogue.models.listeners import *
+
+from django.contrib.auth.models import User as AuthUser
+
+class User(AuthUser):
+ class Meta:
+ proxy = True
+
+ def __unicode__(self):
+ return "%s %s" % (self.first_name, self.last_name)
diff --git
a/apps/catalogue/models/chunk.py
b/apps/catalogue/models/chunk.py
index
770ddbf
..
171ba53
100755
(executable)
--- a/
apps/catalogue/models/chunk.py
+++ b/
apps/catalogue/models/chunk.py
@@
-22,7
+22,7
@@
class Chunk(dvcs_models.Document):
number = models.IntegerField(_('number'))
title = models.CharField(_('title'), max_length=255, blank=True)
slug = models.SlugField(_('slug'))
number = models.IntegerField(_('number'))
title = models.CharField(_('title'), max_length=255, blank=True)
slug = models.SlugField(_('slug'))
- gallery_start = models.IntegerField(_('gallery start'), null=True, blank=True)
+ gallery_start = models.IntegerField(_('gallery start'), null=True, blank=True
, default=1
)
# cache
_short_html = models.TextField(null=True, blank=True, editable=False)
# cache
_short_html = models.TextField(null=True, blank=True, editable=False)
diff --git
a/apps/catalogue/tasks.py
b/apps/catalogue/tasks.py
index
53b867b
..
1bb4bc9
100644
(file)
--- a/
apps/catalogue/tasks.py
+++ b/
apps/catalogue/tasks.py
@@
-12,12
+12,8
@@
def _refresh_by_pk(cls, pk, language=None):
finally:
translation.activate(prev_language)
finally:
translation.activate(prev_language)
-if settings.USE_CELERY:
- def refresh_instance(instance):
- _refresh_by_pk.delay(type(instance), instance.pk, translation.get_language())
-else:
- def refresh_instance(instance):
- instance.refresh()
+def refresh_instance(instance):
+ _refresh_by_pk.delay(type(instance), instance.pk, translation.get_language())
@task
@task
@@
-33,10
+29,6
@@
def _publishable_error(book, language=None):
finally:
translation.activate(prev_language)
finally:
translation.activate(prev_language)
-if settings.USE_CELERY:
- def publishable_error(book):
- task = _publishable_error.delay(book, translation.get_language())
- return task.wait()
-else:
- def publishable_error(book):
- return _publishable_error(book)
+def publishable_error(book):
+ return _publishable_error.delay(book,
+ translation.get_language()).wait()
diff --git
a/apps/catalogue/views.py
b/apps/catalogue/views.py
index
3459fda
..
89232ea
100644
(file)
--- a/
apps/catalogue/views.py
+++ b/
apps/catalogue/views.py
@@
-285,6
+285,9
@@
def chunk_add(request, slug, chunk):
doc.split(creator=creator,
slug=form.cleaned_data['slug'],
title=form.cleaned_data['title'],
doc.split(creator=creator,
slug=form.cleaned_data['slug'],
title=form.cleaned_data['title'],
+ gallery_start=form.cleaned_data['gallery_start'],
+ user=form.cleaned_data['user'],
+ stage=form.cleaned_data['stage']
)
return http.HttpResponseRedirect(doc.book.get_absolute_url())
)
return http.HttpResponseRedirect(doc.book.get_absolute_url())
diff --git
a/redakcja/localsettings.sample
b/redakcja/localsettings.sample
index
b2f2b5c
..
509022e
100644
(file)
--- a/
redakcja/localsettings.sample
+++ b/
redakcja/localsettings.sample
@@
-31,4
+31,4
@@
COMPRESS = False
APICLIENT_WL_CONSUMER_KEY = None
APICLIENT_WL_CONSUMER_SECRET = None
APICLIENT_WL_CONSUMER_KEY = None
APICLIENT_WL_CONSUMER_SECRET = None
-
USE_CELERY = Tru
e
+
CELERY_ALWAYS_EAGER = Fals
e
diff --git
a/redakcja/static/css/filelist.css
b/redakcja/static/css/filelist.css
index
4aead73
..
f517ea6
100644
(file)
--- a/
redakcja/static/css/filelist.css
+++ b/
redakcja/static/css/filelist.css
@@
-66,6
+66,10
@@
td {
.editable input, .editable select, .editable textarea {
width: 400px;
}
.editable input, .editable select, .editable textarea {
width: 400px;
}
+.editable .number-input {
+ width: 100px;
+}
+
#login-box {
float: right;
#login-box {
float: right;