# HG changeset patch # User cavaliet # Date 1395669824 -3600 # Node ID 1f6844db7d4d58401cc778e33a72deda917551f8 # Parent 4ab945846bbfc8675ab57e678a64eda2617e0469 little corrections diff -r 4ab945846bbf -r 1f6844db7d4d src/ldt/ldt/api/ldt/resources/tag.py --- 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 [ diff -r 4ab945846bbf -r 1f6844db7d4d src/ldt/ldt/api/ldt/serializers/cinelabserializer.py --- 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." diff -r 4ab945846bbf -r 1f6844db7d4d src/ldt/ldt/ldt_utils/models.py --- 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()