Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
26b1e8d8
Commit
26b1e8d8
authored
Apr 15, 2015
by
E. Kolpakov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Made methods with no implementation abstract
parent
0b2b9fe2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
4 deletions
+7
-4
cms/djangoapps/contentstore/courseware_index.py
+7
-4
No files found.
cms/djangoapps/contentstore/courseware_index.py
View file @
26b1e8d8
""" Code to allow module store to interface with courseware index """
""" Code to allow module store to interface with courseware index """
from
__future__
import
absolute_import
from
__future__
import
absolute_import
from
abc
import
ABCMeta
,
abstractmethod
from
datetime
import
timedelta
from
datetime
import
timedelta
import
logging
import
logging
from
six
import
add_metaclass
from
django.conf
import
settings
from
django.conf
import
settings
from
django.utils.translation
import
ugettext
as
_
from
django.utils.translation
import
ugettext
as
_
...
@@ -29,10 +30,12 @@ class SearchIndexingError(Exception):
...
@@ -29,10 +30,12 @@ class SearchIndexingError(Exception):
self
.
error_list
=
error_list
self
.
error_list
=
error_list
@add_metaclass
(
ABCMeta
)
class
SearchIndexerBase
(
object
):
class
SearchIndexerBase
(
object
):
"""
"""
Base class to perform indexing for courseware or library search from different modulestores
Base class to perform indexing for courseware or library search from different modulestores
"""
"""
__metaclass__
=
ABCMeta
INDEX_NAME
=
None
INDEX_NAME
=
None
DOCUMENT_TYPE
=
None
DOCUMENT_TYPE
=
None
...
@@ -51,19 +54,19 @@ class SearchIndexerBase(object):
...
@@ -51,19 +54,19 @@ class SearchIndexerBase(object):
return
settings
.
FEATURES
.
get
(
cls
.
ENABLE_INDEXING_KEY
,
False
)
return
settings
.
FEATURES
.
get
(
cls
.
ENABLE_INDEXING_KEY
,
False
)
@classmethod
@classmethod
@abstractmethod
def
normalize_structure_key
(
cls
,
structure_key
):
def
normalize_structure_key
(
cls
,
structure_key
):
""" Normalizes structure key for use in indexing """
""" Normalizes structure key for use in indexing """
raise
NotImplementedError
(
"Should be overridden in child classes"
)
@classmethod
@classmethod
@abstractmethod
def
_fetch_top_level
(
cls
,
modulestore
,
structure_key
):
def
_fetch_top_level
(
cls
,
modulestore
,
structure_key
):
""" Fetch the item from the modulestore location """
""" Fetch the item from the modulestore location """
raise
NotImplementedError
(
"Should be overridden in child classes"
)
@classmethod
@classmethod
@abstractmethod
def
_get_location_info
(
cls
,
normalized_structure_key
):
def
_get_location_info
(
cls
,
normalized_structure_key
):
""" Builds location info dictionary """
""" Builds location info dictionary """
raise
NotImplementedError
(
"Should be overridden in child classes"
)
@classmethod
@classmethod
def
_id_modifier
(
cls
,
usage_id
):
def
_id_modifier
(
cls
,
usage_id
):
...
...
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