Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Websites UFRPE
Wagtail Videos
Commits
5b4a65c6
Commit
5b4a65c6
authored
Dec 08, 2016
by
seb-b
Committed by
GitHub
Dec 08, 2016
Browse files
Merge pull request #14 from takeflight/wagtail-1.8
Add Wagtail 1.8 support
parents
16d57461
06b831c8
Changes
9
Show whitespace changes
Inline
Side-by-side
.travis.yml
View file @
5b4a65c6
...
...
@@ -8,43 +8,21 @@ env:
matrix
:
-
TOX_ENV=flake8,isort
python
:
-
2.7
-
3.4
-
3.5
env
:
-
DJANGO='19' WAGTAIL='17'
-
DJANGO='110' WAGTAIL='17'
-
DJANGO='19' WAGTAIL='18'
-
DJANGO='110' WAGTAIL='18'
matrix
:
-
env
:
DJANGO='18' WAGTAIL='14'
python
:
2.7
-
env
:
DJANGO='18' WAGTAIL='14'
python
:
3.4
-
env
:
DJANGO='18' WAGTAIL='14'
python
:
3.5
-
env
:
DJANGO='19' WAGTAIL='14'
python
:
2.7
-
env
:
DJANGO='19' WAGTAIL='14'
python
:
3.4
-
env
:
DJANGO='19' WAGTAIL='14'
python
:
3.5
-
env
:
DJANGO='18' WAGTAIL='15'
python
:
2.7
-
env
:
DJANGO='18' WAGTAIL='15'
python
:
3.4
-
env
:
DJANGO='18' WAGTAIL='15'
python
:
3.5
-
env
:
DJANGO='19' WAGTAIL='15'
python
:
2.7
-
env
:
DJANGO='19' WAGTAIL='15'
python
:
3.4
-
env
:
DJANGO='19' WAGTAIL='15'
python
:
3.5
-
env
:
DJANGO='19' WAGTAIL='16'
python
:
2.7
-
env
:
DJANGO='19' WAGTAIL='16'
python
:
3.4
-
env
:
DJANGO='19' WAGTAIL='16'
python
:
3.5
-
env
:
DJANGO='110' WAGTAIL='16'
python
:
2.7
-
env
:
DJANGO='110' WAGTAIL='16'
python
:
3.4
-
env
:
DJANGO='110' WAGTAIL='16'
python
:
3.5
include
:
-
env
:
TOX_ENV='flake8,isort'
python
:
3.5
...
...
README.rst
View file @
5b4a65c6
...
...
@@ -8,7 +8,7 @@ html5 compliant codec using ffmpeg.
Requirements
------------
- Wagtail > 1.
4
- Wagtail > 1.
7
- `ffmpeg <https://ffmpeg.org/>`__
Installing
...
...
setup.py
View file @
5b4a65c6
...
...
@@ -18,8 +18,8 @@ setup(
url
=
'https://github.com/takeflight/wagtailvideos'
,
install_requires
=
[
'wagtail>=1.
4
'
,
'Django>=1.
8
'
,
'wagtail>=1.
7
'
,
'Django>=1.
9
'
,
'django-enumchoicefield==0.6.0'
,
],
extras_require
=
{
...
...
tox.ini
View file @
5b4a65c6
...
...
@@ -2,12 +2,7 @@
skip_missing_interpreters
=
True
envlist
=
# Wagtail LTS
py{27,34,35}-dj{18,19}-wt14
# Last version
py{27,34,35}-dj{18,19}-wt15
# Current version
py{27,34,35}-dj{19,110}-wt16
py{27,34,35}-dj{19,110}-wt{17,18}
# Enforce good style
flake8,isort
...
...
@@ -23,10 +18,8 @@ deps =
dj18:
Django~=1.8.0
dj19:
Django~=1.9.0
dj110:
Django~=1.10.0
wt13:
wagtail~=1.3.0
wt14:
wagtail~=1.4.0
wt15:
wagtail~=1.5.0
wt16:
wagtail~=1.6.0
wt17:
wagtail~=1.7.0
wt18:
wagtail~=1.8rc1
[testenv:flake8]
deps
=
flake8
...
...
wagtailvideos/jinja2tags.py
View file @
5b4a65c6
...
...
@@ -23,4 +23,5 @@ class WagtailVideosExtension(Extension):
'video'
:
video
,
})
videos
=
WagtailVideosExtension
wagtailvideos/migrations/0001_initial.py
View file @
5b4a65c6
...
...
@@ -4,8 +4,8 @@ from __future__ import absolute_import, print_function, unicode_literals
import
django.db.models.deletion
import
taggit.managers
import
wagtail.wagtailadmin.taggable
import
wagtail.wagtailcore.models
import
wagtail.wagtailsearch.index
from
django.conf
import
settings
from
django.db
import
migrations
,
models
...
...
@@ -38,6 +38,6 @@ class Migration(migrations.Migration):
options
=
{
'abstract'
:
False
,
},
bases
=
(
models
.
Model
,
wagtail
.
wagtailadmin
.
taggable
.
TagSearchable
),
bases
=
(
models
.
Model
,),
),
]
wagtailvideos/models.py
View file @
5b4a65c6
...
...
@@ -24,7 +24,6 @@ from django.utils.text import mark_safe
from
django.utils.translation
import
ugettext_lazy
as
_
from
enumchoicefield
import
ChoiceEnum
,
EnumChoiceField
from
taggit.managers
import
TaggableManager
from
wagtail.wagtailadmin.taggable
import
TagSearchable
from
wagtail.wagtailadmin.utils
import
get_object_usage
from
wagtail.wagtailcore.models
import
CollectionMember
from
wagtail.wagtailsearch
import
index
...
...
@@ -77,7 +76,7 @@ def get_upload_to(instance, filename):
@
python_2_unicode_compatible
class
AbstractVideo
(
CollectionMember
,
TagSearchable
):
class
AbstractVideo
(
CollectionMember
,
index
.
Indexed
,
models
.
Model
):
title
=
models
.
CharField
(
max_length
=
255
,
verbose_name
=
_
(
'title'
))
file
=
models
.
FileField
(
verbose_name
=
_
(
'file'
),
upload_to
=
get_upload_to
)
...
...
@@ -95,7 +94,11 @@ class AbstractVideo(CollectionMember, TagSearchable):
objects
=
VideoQuerySet
.
as_manager
()
search_fields
=
list
(
TagSearchable
.
search_fields
)
+
list
(
CollectionMember
.
search_fields
)
+
[
search_fields
=
list
(
CollectionMember
.
search_fields
)
+
[
index
.
SearchField
(
'title'
,
partial_match
=
True
,
boost
=
10
),
index
.
RelatedFields
(
'tags'
,
[
index
.
SearchField
(
'name'
,
partial_match
=
True
,
boost
=
10
),
]),
index
.
FilterField
(
'uploaded_by_user'
),
]
...
...
wagtailvideos/views/chooser.py
View file @
5b4a65c6
...
...
@@ -7,7 +7,8 @@ from django.shortcuts import get_object_or_404, render
from
wagtail.utils.pagination
import
paginate
from
wagtail.wagtailadmin.forms
import
SearchForm
from
wagtail.wagtailadmin.modal_workflow
import
render_modal_workflow
from
wagtail.wagtailadmin.utils
import
PermissionPolicyChecker
from
wagtail.wagtailadmin.utils
import
(
PermissionPolicyChecker
,
popular_tags_for_model
)
from
wagtail.wagtailcore.models
import
Collection
from
wagtail.wagtailsearch
import
index
as
search_index
from
wagtail.wagtailsearch.backends
import
get_search_backends
...
...
@@ -88,7 +89,7 @@ def chooser(request):
'searchform'
:
searchform
,
'is_searching'
:
False
,
'query_string'
:
q
,
'popular_tags'
:
Video
.
popular_tags
(
),
'popular_tags'
:
popular_tags
_for_model
(
Video
),
'collections'
:
collections
,
})
...
...
wagtailvideos/views/videos.py
View file @
5b4a65c6
...
...
@@ -10,7 +10,8 @@ from django.views.decorators.vary import vary_on_headers
from
wagtail.utils.pagination
import
paginate
from
wagtail.wagtailadmin
import
messages
from
wagtail.wagtailadmin.forms
import
SearchForm
from
wagtail.wagtailadmin.utils
import
PermissionPolicyChecker
from
wagtail.wagtailadmin.utils
import
(
PermissionPolicyChecker
,
popular_tags_for_model
)
from
wagtail.wagtailcore.models
import
Collection
from
wagtail.wagtailsearch.backends
import
get_search_backends
...
...
@@ -66,7 +67,7 @@ def index(request):
'is_searching'
:
bool
(
query_string
),
'search_form'
:
form
,
'popular_tags'
:
Video
.
popular_tags
(
),
'popular_tags'
:
popular_tags
_for_model
(
Video
),
'current_collection'
:
current_collection
,
})
return
response
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment