Skip to content

Commit dcb7e49

Browse files
shaileshmishrashaileshmishra
authored andcommitted
code_coverage improved from 85% to 92%
1 parent b4eedc3 commit dcb7e49

File tree

4 files changed

+25
-6
lines changed

4 files changed

+25
-6
lines changed

changelog.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
**CHANGELOG**
33
================
44

5+
ENHANCEMENT, NEW FEATURE, BUG RESOLVE
6+
57
*v1.2.0*
68
============
79

contentstack/assetquery.py

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,9 +97,9 @@ def relative_url(self):
9797
"""
9898
self.asset_query_params["relative_urls"] = "true"
9999
return self
100-
100+
101101
def include_fallback(self):
102-
r"""Include the fallback locale publish content, if specified locale content is not publish.
102+
"""Include the fallback locale publish content, if specified locale content is not publish.
103103
104104
:return: AssetQuery, so we can chain the call
105105
@@ -114,6 +114,23 @@ def include_fallback(self):
114114
self.asset_query_params['include_fallback'] = "true"
115115
return self
116116

117+
def locale(self, locale: str):
118+
"""Enter locale code. e.g., en-us
119+
This retrieves published entries of specific locale..
120+
121+
:return: AssetQuery, so we can chain the call
122+
123+
----------------------------
124+
Example::
125+
126+
>>> import contentstack
127+
>>> stack = contentstack.Stack('api_key', 'delivery_token', 'environment')
128+
>>> result = stack.asset_query().locale('en-us').find()
129+
----------------------------
130+
"""
131+
self.asset_query_params['locale'] = locale
132+
return self
133+
117134
def find(self):
118135
r"""This call fetches the list of all the assets of a particular stack.
119136
It also returns the content of each asset in JSON format.

contentstack/entryqueryable.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,6 @@ def excepts(self, field_uid: str):
7373

7474
def include_reference(self, field_uid):
7575
"""
76-
**[Include Reference]:**
7776
When you fetch an entry of a content type that has a reference field,
7877
by default, the content of the referred entry is not fetched.
7978
It only fetches the UID of the referred entry, along with the content of
@@ -176,3 +175,4 @@ def add_param(self, key: str, value: str):
176175
"""
177176
if None not in (key, value):
178177
self.entry_queryable_param[key] = value
178+
return self

coverage.svg

Lines changed: 3 additions & 3 deletions
Loading

0 commit comments

Comments
 (0)