-
Notifications
You must be signed in to change notification settings - Fork 82
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #11 from priyankarani/feature/task-1736
Store View API and Magento API #1736
- Loading branch information
Showing
3 changed files
with
65 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
# -*- coding: utf-8 -*- | ||
""" | ||
miscellaneous | ||
This API allows to access additional magento information | ||
:copyright: (c) 2013 by Openlabs Technologies & Consulting (P) Limited | ||
:license: AGPLv3, see LICENSE for more details. | ||
""" | ||
from magento.api import API | ||
|
||
|
||
class Store(API): | ||
""" | ||
This API allows to retrieve information about store views | ||
""" | ||
|
||
__slots__ = () | ||
|
||
def info(self, store_id): | ||
""" | ||
Returns information for store view | ||
:param store_id: ID of store view | ||
:return: Dictionary containing information about store view | ||
""" | ||
return self.call('store.info', [store_id]) | ||
|
||
def list(self, filters=None): | ||
""" | ||
Returns list of store views | ||
:param filters: Dictionary of filters. | ||
Format : | ||
{<attribute>:{<operator>:<value>}} | ||
Example : | ||
{'store_id':{'=':'1'}} | ||
:return: List of Dictionaries | ||
""" | ||
return self.call('store.list', [filters]) | ||
|
||
|
||
class Magento(API): | ||
""" | ||
This API returns information about current magento installation | ||
""" | ||
|
||
__slots__ = () | ||
|
||
def info(self): | ||
""" | ||
Returns information about current magento | ||
""" | ||
return self.call('core_magento.info', []) |