Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
converse.js
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
converse.js
Commits
cd79e2de
Commit
cd79e2de
authored
Mar 19, 2012
by
Michal Čihař
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/master'
parents
d421c4e6
ca0a23dc
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
0 deletions
+11
-0
trans/views.py
trans/views.py
+11
-0
No files found.
trans/views.py
View file @
cd79e2de
...
...
@@ -385,6 +385,17 @@ def get_similar(request, unit_id):
similar
=
Unit
.
objects
.
similar
(
unit
)
# distinct('target') works with Django 1.4 so let's emulate that
# based on presumption we won't get too many results
targets
=
{}
res
=
[]
for
s
in
similar
:
if
s
.
target
in
targets
:
continue
targets
[
s
.
target
]
=
1
res
.
append
(
s
)
similar
=
res
return
render_to_response
(
'similar.html'
,
RequestContext
(
request
,
{
'similar'
:
similar
,
}))
...
...
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