src/ldt/ldt/ldt_utils/views/rdf.py
changeset 319 c45aed3c7a89
parent 315 877f89ec1efa
child 886 3ccedd271e36
equal deleted inserted replaced
318:45d028517c34 319:c45aed3c7a89
     1 from django.conf import settings
     1 from django.http import HttpResponse, HttpResponseForbidden
     2 from django.contrib.auth.decorators import login_required
     2 from django.utils.translation import ugettext as _
     3 from django.contrib.auth.models import User, Group
     3 from ldt.ldt_utils.models import Project
     4 from django.core.cache import cache
       
     5 from django.core.urlresolvers import reverse
       
     6 from django.core.paginator import Paginator, InvalidPage, EmptyPage
       
     7 from django.db.models import Q
       
     8 from django.forms.models import model_to_dict
       
     9 from django.forms.util import ErrorList
       
    10 from django.http import (HttpResponse, HttpResponseRedirect,
       
    11     HttpResponseForbidden, HttpResponseServerError)
       
    12 from ldt.indexation import get_results_with_context, highlight_documents
       
    13 from django.shortcuts import (render_to_response, get_object_or_404,
       
    14     get_list_or_404)
       
    15 from django.template import RequestContext
       
    16 from django.template.loader import render_to_string
       
    17 from django.utils import simplejson
       
    18 from django.utils.html import escape
       
    19 from django.utils.translation import ugettext as _, ungettext
       
    20 from ldt.ldt_utils.forms import (LdtAddForm, SearchForm, AddProjectForm, CopyProjectForm,
       
    21     ContentForm, MediaForm, GroupAddForm)
       
    22 from guardian.shortcuts import remove_perm, get_objects_for_group, get_objects_for_user
       
    23 from ldt.ldt_utils.models import Content, Media, Project
       
    24 from ldt.ldt_utils.utils import boolean_convert, LdtUtils, LdtSearch
       
    25 from ldt.security.utils import (assign_perm_to_obj, set_forbidden_stream, 
       
    26     add_change_attr, get_userlist, get_userlist_model, get_userlist_group)
       
    27 from ldt.security.cache import get_cached_checker, cached_assign
       
    28 from lxml.html import fragment_fromstring
       
    29 #from models import Media, Project
       
    30 from ldt.ldt_utils.projectserializer import ProjectSerializer
     4 from ldt.ldt_utils.projectserializer import ProjectSerializer
    31 from urllib2 import urlparse
       
    32 from operator import itemgetter
       
    33 from itertools import groupby
       
    34 import base64
       
    35 import django.core.urlresolvers
       
    36 import ldt.auth as ldt_auth
     5 import ldt.auth as ldt_auth
    37 import ldt.utils.path as ldt_utils_path
       
    38 import logging
     6 import logging
    39 import lxml.etree
     7 import lxml.etree
    40 import mimetypes
       
    41 import os
       
    42 import urllib2
       
    43 import subprocess
       
    44 import re
       
    45 import datetime
       
    46 
     8 
    47 
     9 
    48 def project_annotations_rdf(request, ldt_id):
    10 def project_annotations_rdf(request, ldt_id):
    49 
    11 
    50     project = Project.safe_objects.get(ldt_id=ldt_id); #@UndefinedVariable
    12     project = Project.safe_objects.get(ldt_id=ldt_id); #@UndefinedVariable