Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
La Quadrature du Net
Respect My Net
Commits
5f55aa41
Commit
5f55aa41
authored
Feb 10, 2016
by
Okhin
Browse files
Adding the SearchIndexes for Operator and Violations
parent
cffafb56
Changes
1
Hide whitespace changes
Inline
Side-by-side
bt/search_indexes.py
0 → 100644
View file @
5f55aa41
from
haystack
import
indexes
from
models
import
Operator
,
Violation
class
OperatorIndex
(
indexes
.
SearchIndex
,
indexes
.
Indexable
):
text
=
indexes
.
CharField
(
document
=
True
,
use_template
=
True
)
def
get_model
(
self
):
return
Operator
class
ViolationIndexes
(
indexes
.
SearchIndex
,
indexes
.
Indexable
):
text
=
indexes
.
CharField
(
document
=
True
,
use_template
=
True
)
operator
=
indexes
.
CharField
(
model_attr
=
"operator_ref"
)
country
=
indexes
.
CharField
(
model_attr
=
"country"
)
contract
=
indexes
.
CharField
(
model_attr
=
"contract_excerpt"
)
type
=
indexes
.
BooleanField
(
model_attr
=
"contractual"
)
def
get_model
(
self
):
return
Violation
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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