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
2e36a9fb
Commit
2e36a9fb
authored
Apr 25, 2014
by
Michal Čihař
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move search metadata to separate module
Signed-off-by:
Michal Čihař
<
michal@cihar.com
>
parent
b0839758
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
36 additions
and
13 deletions
+36
-13
weblate/trans/models/__init__.py
weblate/trans/models/__init__.py
+2
-1
weblate/trans/models/search.py
weblate/trans/models/search.py
+33
-0
weblate/trans/models/unitdata.py
weblate/trans/models/unitdata.py
+0
-11
weblate/trans/search.py
weblate/trans/search.py
+1
-1
No files found.
weblate/trans/models/__init__.py
View file @
2e36a9fb
...
@@ -29,8 +29,9 @@ from weblate.trans.models.subproject import SubProject
...
@@ -29,8 +29,9 @@ from weblate.trans.models.subproject import SubProject
from
weblate.trans.models.translation
import
Translation
from
weblate.trans.models.translation
import
Translation
from
weblate.trans.models.unit
import
Unit
from
weblate.trans.models.unit
import
Unit
from
weblate.trans.models.unitdata
import
(
from
weblate.trans.models.unitdata
import
(
Check
,
Suggestion
,
Comment
,
IndexUpdate
,
Vote
Check
,
Suggestion
,
Comment
,
Vote
)
)
from
weblate.trans.models.search
import
IndexUpdate
from
weblate.trans.models.changes
import
Change
from
weblate.trans.models.changes
import
Change
from
weblate.trans.models.dictionary
import
Dictionary
from
weblate.trans.models.dictionary
import
Dictionary
from
weblate.trans.models.source
import
Source
from
weblate.trans.models.source
import
Source
...
...
weblate/trans/models/search.py
0 → 100644
View file @
2e36a9fb
# -*- coding: utf-8 -*-
#
# Copyright © 2012 - 2014 Michal Čihař <michal@cihar.com>
#
# This file is part of Weblate <http://weblate.org/>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
from
django.db
import
models
from
weblate.trans.models.unit
import
Unit
class
IndexUpdate
(
models
.
Model
):
unit
=
models
.
ForeignKey
(
Unit
)
source
=
models
.
BooleanField
(
default
=
True
)
class
Meta
:
app_label
=
'trans'
def
__unicode__
(
self
):
return
self
.
unit
.
__unicode__
()
weblate/trans/models/unitdata.py
View file @
2e36a9fb
...
@@ -336,14 +336,3 @@ class Check(models.Model, RelatedUnitMixin):
...
@@ -336,14 +336,3 @@ class Check(models.Model, RelatedUnitMixin):
# Update related unit flags
# Update related unit flags
for
unit
in
self
.
get_related_units
():
for
unit
in
self
.
get_related_units
():
unit
.
update_has_failing_check
(
False
)
unit
.
update_has_failing_check
(
False
)
class
IndexUpdate
(
models
.
Model
):
unit
=
models
.
ForeignKey
(
Unit
)
source
=
models
.
BooleanField
(
default
=
True
)
class
Meta
:
app_label
=
'trans'
def
__unicode__
(
self
):
return
self
.
unit
.
__unicode__
()
weblate/trans/search.py
View file @
2e36a9fb
...
@@ -155,7 +155,7 @@ def update_index_unit(unit, source=True):
...
@@ -155,7 +155,7 @@ def update_index_unit(unit, source=True):
'''
'''
# Should this happen in background?
# Should this happen in background?
if
appsettings
.
OFFLOAD_INDEXING
:
if
appsettings
.
OFFLOAD_INDEXING
:
from
weblate.trans.models.
unitdata
import
IndexUpdate
from
weblate.trans.models.
search
import
IndexUpdate
update
,
created
=
IndexUpdate
.
objects
.
get_or_create
(
update
,
created
=
IndexUpdate
.
objects
.
get_or_create
(
defaults
=
{
'source'
:
source
},
defaults
=
{
'source'
:
source
},
unit
=
unit
,
unit
=
unit
,
...
...
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