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
c8dd772f
Commit
c8dd772f
authored
Jul 10, 2012
by
Michal Čihař
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add methods for getting some summaries about project stats
parent
d95b4bd3
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
0 deletions
+19
-0
weblate/trans/models.py
weblate/trans/models.py
+19
-0
No files found.
weblate/trans/models.py
View file @
c8dd772f
...
@@ -134,6 +134,25 @@ class Project(models.Model):
...
@@ -134,6 +134,25 @@ class Project(models.Model):
return
0
return
0
return
round
(
translations
[
'translated__sum'
]
*
100.0
/
translations
[
'total__sum'
],
1
)
return
round
(
translations
[
'translated__sum'
]
*
100.0
/
translations
[
'total__sum'
],
1
)
def
get_total
(
self
):
'''
Calculates total number of strings to translate. This is done based on assumption that
all languages have same number of strings.
'''
total
=
0
for
p
in
self
.
subproject_set
.
all
():
try
:
total
+=
p
.
translation_set
.
all
()[
0
].
total
except
Translation
.
DoesNotExist
:
pass
return
total
def
get_language_count
(
self
):
'''
Returns number of languages used in this project.
'''
return
Language
.
objects
.
filter
(
translation__subproject__project
=
self
).
distinct
().
count
()
def
git_needs_commit
(
self
):
def
git_needs_commit
(
self
):
'''
'''
Checks whether there are some not commited changes.
Checks whether there are some not commited changes.
...
...
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