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
0b92d667
Commit
0b92d667
authored
Sep 23, 2014
by
Michal Čihař
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Turn method into property for Django 1.7 compatibility (bug #526)
Signed-off-by:
Michal Čihař
<
michal@cihar.com
>
parent
e350b8fd
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
17 additions
and
13 deletions
+17
-13
weblate/accounts/models.py
weblate/accounts/models.py
+2
-1
weblate/html/translation.html
weblate/html/translation.html
+1
-1
weblate/sitemaps.py
weblate/sitemaps.py
+4
-4
weblate/trans/management/commands/commit_pending.py
weblate/trans/management/commands/commit_pending.py
+1
-1
weblate/trans/models/project.py
weblate/trans/models/project.py
+3
-2
weblate/trans/models/subproject.py
weblate/trans/models/subproject.py
+2
-1
weblate/trans/models/translation.py
weblate/trans/models/translation.py
+3
-2
weblate/trans/views/api.py
weblate/trans/views/api.py
+1
-1
No files found.
weblate/accounts/models.py
View file @
0b92d667
...
@@ -419,7 +419,8 @@ class Profile(models.Model):
...
@@ -419,7 +419,8 @@ class Profile(models.Model):
'user'
:
self
.
user
.
username
'user'
:
self
.
user
.
username
})
})
def
get_last_change
(
self
):
@
property
def
last_change
(
self
):
'''
'''
Returns date of last change user has done in Weblate.
Returns date of last change user has done in Weblate.
'''
'''
...
...
weblate/html/translation.html
View file @
0b92d667
...
@@ -184,7 +184,7 @@
...
@@ -184,7 +184,7 @@
</tr>
</tr>
<tr>
<tr>
<th>
{% trans "Last change" %}
<th>
<th>
{% trans "Last change" %}
<th>
<td
class=
"number"
colspan=
"3"
>
{{ object.
get_
last_change }}
</td>
<td
class=
"number"
colspan=
"3"
>
{{ object.last_change }}
</td>
</tr>
</tr>
<tr>
<tr>
<th>
{% trans "Last author" %}
<th>
<th>
{% trans "Last author" %}
<th>
...
...
weblate/sitemaps.py
View file @
0b92d667
...
@@ -25,26 +25,26 @@ from weblate.accounts.models import Profile
...
@@ -25,26 +25,26 @@ from weblate.accounts.models import Profile
PROJECT_DICT
=
{
PROJECT_DICT
=
{
'queryset'
:
Project
.
objects
.
all_acl
(
None
),
'queryset'
:
Project
.
objects
.
all_acl
(
None
),
'date_field'
:
'
get_
last_change'
,
'date_field'
:
'last_change'
,
}
}
SUBPROJECT_DICT
=
{
SUBPROJECT_DICT
=
{
'queryset'
:
SubProject
.
objects
.
filter
(
'queryset'
:
SubProject
.
objects
.
filter
(
project__in
=
Project
.
objects
.
all_acl
(
None
)
project__in
=
Project
.
objects
.
all_acl
(
None
)
),
),
'date_field'
:
'
get_
last_change'
,
'date_field'
:
'last_change'
,
}
}
TRANSLATION_DICT
=
{
TRANSLATION_DICT
=
{
'queryset'
:
Translation
.
objects
.
filter
(
'queryset'
:
Translation
.
objects
.
filter
(
subproject__project__in
=
Project
.
objects
.
all_acl
(
None
)
subproject__project__in
=
Project
.
objects
.
all_acl
(
None
)
),
),
'date_field'
:
'
get_
last_change'
,
'date_field'
:
'last_change'
,
}
}
USER_DICT
=
{
USER_DICT
=
{
'queryset'
:
Profile
.
objects
.
all
(),
'queryset'
:
Profile
.
objects
.
all
(),
'date_field'
:
'
get_
last_change'
,
'date_field'
:
'last_change'
,
}
}
...
...
weblate/trans/management/commands/commit_pending.py
View file @
0b92d667
...
@@ -45,7 +45,7 @@ class Command(WeblateLangCommand):
...
@@ -45,7 +45,7 @@ class Command(WeblateLangCommand):
if
not
translation
.
git_needs_commit
():
if
not
translation
.
git_needs_commit
():
continue
continue
last_change
=
translation
.
get_last_change
()
last_change
=
translation
.
last_change
if
last_change
is
None
:
if
last_change
is
None
:
continue
continue
if
last_change
>
age
:
if
last_change
>
age
:
...
...
weblate/trans/models/project.py
View file @
0b92d667
...
@@ -432,12 +432,13 @@ class Project(models.Model, PercentMixin, URLMixin, PathMixin):
...
@@ -432,12 +432,13 @@ class Project(models.Model, PercentMixin, URLMixin, PathMixin):
ret
|=
resource
.
can_push
()
ret
|=
resource
.
can_push
()
return
ret
return
ret
def
get_last_change
(
self
):
@
property
def
last_change
(
self
):
"""
"""
Returns date of last change done in Weblate.
Returns date of last change done in Weblate.
"""
"""
resources
=
self
.
subproject_set
.
all
()
resources
=
self
.
subproject_set
.
all
()
changes
=
[
resource
.
get_last_change
()
for
resource
in
resources
]
changes
=
[
resource
.
last_change
for
resource
in
resources
]
changes
=
[
c
for
c
in
changes
if
c
is
not
None
]
changes
=
[
c
for
c
in
changes
if
c
is
not
None
]
if
not
changes
:
if
not
changes
:
return
None
return
None
...
...
weblate/trans/models/subproject.py
View file @
0b92d667
...
@@ -1172,7 +1172,8 @@ class SubProject(models.Model, PercentMixin, URLMixin, PathMixin):
...
@@ -1172,7 +1172,8 @@ class SubProject(models.Model, PercentMixin, URLMixin, PathMixin):
return
self
.
_template_store
return
self
.
_template_store
def
get_last_change
(
self
):
@
property
def
last_change
(
self
):
'''
'''
Returns date of last change done in Weblate.
Returns date of last change done in Weblate.
'''
'''
...
...
weblate/trans/models/translation.py
View file @
0b92d667
...
@@ -724,7 +724,8 @@ class Translation(models.Model, URLMixin, PercentMixin):
...
@@ -724,7 +724,8 @@ class Translation(models.Model, URLMixin, PercentMixin):
except
IndexError
:
except
IndexError
:
return
None
return
None
def
get_last_change
(
self
):
@
property
def
last_change
(
self
):
'''
'''
Returns date of last change done in Weblate.
Returns date of last change done in Weblate.
'''
'''
...
@@ -746,7 +747,7 @@ class Translation(models.Model, URLMixin, PercentMixin):
...
@@ -746,7 +747,7 @@ class Translation(models.Model, URLMixin, PercentMixin):
# Commit changes
# Commit changes
self
.
git_commit
(
self
.
git_commit
(
request
,
last
,
self
.
get_last_change
()
,
True
,
True
,
skip_push
request
,
last
,
self
.
last_change
,
True
,
True
,
skip_push
)
)
def
get_author_name
(
self
,
user
,
email
=
True
):
def
get_author_name
(
self
,
user
,
email
=
True
):
...
...
weblate/trans/views/api.py
View file @
0b92d667
...
@@ -270,7 +270,7 @@ def export_stats(request, project, subproject):
...
@@ -270,7 +270,7 @@ def export_stats(request, project, subproject):
'name'
:
trans
.
language
.
name
,
'name'
:
trans
.
language
.
name
,
'total'
:
trans
.
total
,
'total'
:
trans
.
total
,
'total_words'
:
trans
.
total_words
,
'total_words'
:
trans
.
total_words
,
'last_change'
:
trans
.
get_last_change
()
,
'last_change'
:
trans
.
last_change
,
'last_author'
:
trans
.
get_last_author
(),
'last_author'
:
trans
.
get_last_author
(),
'translated'
:
trans
.
translated
,
'translated'
:
trans
.
translated
,
'translated_words'
:
trans
.
translated_words
,
'translated_words'
:
trans
.
translated_words
,
...
...
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