--- a/src/ldt/ldt/api/ldt/resources/tag.py Thu Feb 06 17:27:59 2014 +0100
+++ b/src/ldt/ldt/api/ldt/resources/tag.py Mon Mar 24 15:03:44 2014 +0100
@@ -1,10 +1,11 @@
from django.conf import settings
from django.conf.urls import url
from django.core.paginator import Paginator, InvalidPage
+from haystack.query import SearchQuerySet
from ldt.ldt_utils.models import Segment
from tagging.models import Tag
from tastypie.http import HttpNotFound
-from tastypie.resources import ModelResource
+from tastypie.resources import ModelResource, ALL
from tastypie.utils import trailing_slash
@@ -13,6 +14,11 @@
allowed_methods = ['get']
resource_name = 'tags'
queryset = Tag.objects.all()
+ filtering = {
+ 'name': ALL,
+ }
+ ordering = ["name"]
+ # exact, iexact, contains, icontains, in, gt, lt, startswith, istartswith, endswith, iendswith, search, regexp, iregexp
def prepend_urls(self):
return [
--- a/src/ldt/ldt/api/ldt/serializers/cinelabserializer.py Thu Feb 06 17:27:59 2014 +0100
+++ b/src/ldt/ldt/api/ldt/serializers/cinelabserializer.py Mon Mar 24 15:03:44 2014 +0100
@@ -411,7 +411,7 @@
do_break = False
for a in cinelab_json["annotations"]:
if not "id" in a or not "begin" in a or not "end" in a or not "tags" in a or not "color" in a or not "media" in a:
- error_string += " Each annotation must have 'id', 'begin', 'end', 'tags' and 'media' fields."
+ error_string += " Each annotation must have 'id', 'begin', 'end', 'tags', 'color' and 'media' fields."
do_break = True
if not "meta" in a:
error_string += " Each annotation must have 'meta' field."
--- a/src/ldt/ldt/ldt_utils/models.py Thu Feb 06 17:27:59 2014 +0100
+++ b/src/ldt/ldt/ldt_utils/models.py Mon Mar 24 15:03:44 2014 +0100
@@ -131,9 +131,9 @@
if self.pk:
everyone = Group.objects.get(name=settings.PUBLIC_GROUP_NAME)
if value:
- assign('ldt_utils.view_media', everyone, self.media_obj)
+ assign('ldt_utils.view_media', everyone, self)
else:
- remove_perm('ldt_utils.view_media', everyone, self.media_obj)
+ remove_perm('ldt_utils.view_media', everyone, self)
return locals()