File tree 4 files changed +25
-3
lines changed
4 files changed +25
-3
lines changed Original file line number Diff line number Diff line change @@ -34,3 +34,4 @@ pip-log.txt
34
34
sdist /
35
35
target /
36
36
var /
37
+ venv /
Original file line number Diff line number Diff line change
1
+ sudo : false
2
+ language : python
3
+ cache : pip
4
+ python :
5
+ - " 3.4"
6
+ - " 2.7"
7
+ install :
8
+ - pip install -U pip
9
+ - pip install -r requirements-test.txt
10
+ script :
11
+ - py.test -ra -vvv --cov
12
+ after_success :
13
+ - bash <(curl -s https://codecov.io/bash)
Original file line number Diff line number Diff line change 1
1
Django Sorting Field
2
2
====================
3
+ .. image :: https://travis-ci.org/andersinno/django-sorting-field.svg?branch=master
4
+ :target: https://travis-ci.org/andersinno/django-sorting-field
5
+ .. image :: https://codecov.io/gh/andersinno/django-sorting-field/branch/master/graph/badge.svg
6
+ :target: https://codecov.io/gh/andersinno/django-sorting-field
3
7
4
8
* This package implements a Django form field + widget for drag & drog sorting of items
5
9
* Sorting any item with a field called ``id `` is supported
@@ -77,9 +81,10 @@ Add the SortingFormField to the CMS Plugin and populate it
77
81
78
82
def __init__ (self , * args , ** kwargs ):
79
83
super (CarouselPluginForm, self ).__init__ (* args, ** kwargs)
80
- self .fields[" carousel_order" ].populate(
81
- items = self .instance.carousel.pictures.all(),
82
- )
84
+ if self .instance.pk:
85
+ self .fields[" carousel_order" ].populate(
86
+ items = self .instance.carousel.pictures.all(),
87
+ )
83
88
84
89
class CMSCarouselPlugin (CMSPluginBase ):
85
90
model = CarouselPlugin
Original file line number Diff line number Diff line change
1
+ -e .
2
+ pytest
3
+ pytest-cov
You can’t perform that action at this time.
0 commit comments