Commit d4bb2189 authored by Administrator's avatar Administrator

Merge branch 'mat_FEATURE_graph'

intégration de mat avec les diff
parents d63afe27 f422c7cd
...@@ -66,7 +66,7 @@ class CorpusController: ...@@ -66,7 +66,7 @@ class CorpusController:
corpus = corpusQuery.first() corpus = corpusQuery.first()
if corpus.type.name != 'Corpus': if corpus.type.name != 'Corpus':
raise Http404("No such corpus: %d" % (corpus_id, )) raise Http404("No such corpus: %d" % (corpus_id, ))
# if corpus.user != {currentUser}: # if corpus.user != request.user:
# raise Http403("Unauthorized access.") # raise Http403("Unauthorized access.")
return corpus return corpus
......
...@@ -41,7 +41,7 @@ urlpatterns = patterns('', ...@@ -41,7 +41,7 @@ urlpatterns = patterns('',
url(r'^api/corpus/(\d+)/metadata$', gargantext_web.api.CorpusController.metadata), url(r'^api/corpus/(\d+)/metadata$', gargantext_web.api.CorpusController.metadata),
url(r'^api/corpus/(\d+)/data$', gargantext_web.api.CorpusController.data), url(r'^api/corpus/(\d+)/data$', gargantext_web.api.CorpusController.data),
# url(r'^graph-it$', gargantext_web.api.CorpusController.data), url(r'^graph-it$', views.graph_it),
) )
from django.conf import settings from django.conf import settings
......
...@@ -428,3 +428,14 @@ def send_graph(request): ...@@ -428,3 +428,14 @@ def send_graph(request):
return response return response
def graph_it(request):
'''The new multimodal graph.'''
t = get_template('graph-it.html')
user = request.user
date = datetime.datetime.now()
html = t.render(Context({
'user': user,
'date': date,
}))
return HttpResponse(html)
\ No newline at end of file
--- models.old.py 2014-11-18 12:12:12.289169335 +0100
+++ models.py 2014-11-18 12:11:31.157171030 +0100
@@ -118,7 +118,7 @@
**kwargs)
def maybe_alias(table):
- if self.query.table_map.has_key(table):
+ if table in self.query.table_map:
return self.query.table_map[table][0]
return table
@@ -153,11 +153,7 @@
name = field[0]
else:
name = field
- if self.query.model._meta.get_field_by_name(name)[
- 0].db_type().startswith('varchar'):
- return 'CAST (T."%s" AS TEXT)' % name
- else:
- return 'T."%s"' % name
+ return 'T."%s"' % name
# The primary key is used in the path; in case it is of a
# custom type, ensure appropriate casting is performed. This
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment