Skip to content

Commit de62fe1

Browse files
shaileshmishrashaileshmishra
authored andcommitted
include_fallback
1 parent 6787326 commit de62fe1

12 files changed

+43
-36
lines changed

CHANGELOG.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
# CHANGELOG
22

33

4-
*v1.2.0*
4+
## _v1.2.0_
55
============
66

7-
_Date: 20-Oct-2020_
7+
_Date: 08-Dec-2020_
88

9-
- include_fallback Support Added
10-
- Timeout support included
9+
- include_fallback Support Added
10+
- Timeout support included
1111

1212
- Entry
1313
- added support for include_fallback.

changelog.rst

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,17 @@ ENHANCEMENT, NEW FEATURE, BUG RESOLVE
99

1010
**Date: 20-Oct-2020**
1111

12-
- include_fallback Support Added
13-
- Timeout support included
14-
15-
16-
**Entry**
17-
- Added support for include_fallback.
18-
**Asset**
19-
- Added support for include_fallback.
20-
**AssetQuery**
21-
- Added support for include_fallback.
22-
**Query**
23-
- Added support for include_fallback.
12+
- **include_fallback support added**
13+
`entry`
14+
- added support for include_fallback.
15+
`asset`
16+
- added support for include_fallback.
17+
`assetquery`
18+
- added support for include_fallback.
19+
`query`
20+
- added support for include_fallback.
21+
22+
- **Timeout support included**
2423

2524
============
2625

contentstack/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
from .https_connection import HTTPSConnection
1515
from .stack import Stack
1616
from .utility import Utils
17-
# from contentstack import *
1817

1918
__title__ = 'contentstack-python'
2019
__author__ = 'Contentstack'

contentstack/assetquery.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,8 @@ def relative_url(self):
9999
return self
100100

101101
def include_fallback(self):
102-
"""Include the fallback locale publish content, if specified locale content is not publish.
102+
"""Retrieve the published content of the fallback locale if an
103+
entry is not localized in specified locale.
103104
104105
:return: AssetQuery, so we can chain the call
105106
@@ -111,7 +112,7 @@ def include_fallback(self):
111112
>>> result = stack.asset_query().include_fallback().find()
112113
----------------------------
113114
"""
114-
self.asset_query_params['include_fallback'] = "true"
115+
self.asset_query_params['include_fallback'] = 'true'
115116
return self
116117

117118
def locale(self, locale: str):

contentstack/basequery.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ def query(self, key: str, value):
165165
key {str} -- key of the query param
166166
value {any} -- value of query param
167167
Raises:
168-
KeyError: when key or value found None
168+
`KeyError`: when key or value found None
169169
Returns:
170170
self-- Class instance, So that method chaining can be performed
171171
"""

contentstack/contenttype.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
content type.
66
"""
77

8-
# ************* Module asset **************
8+
# ************* Module ContentType **************
99
# Your code has been rated at 10.00/10 by pylint
1010

1111
from urllib import parse

contentstack/entryqueryable.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@
44
"""
55

66

7+
# ************* Module EntryQueryable **************
8+
# Your code has been rated at 10/10 by pylint
9+
10+
711
class EntryQueryable:
812
"""
913
This class is base class for the Entry and Query class that shares common functions

contentstack/https_connection.py

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,12 @@
77

88
import platform
99
from json import JSONDecodeError
10-
10+
from requests.adapters import HTTPAdapter
11+
from requests.packages.urllib3.util.retry import Retry
1112
import requests
1213
from requests.exceptions import Timeout, HTTPError
13-
import contentstack
1414

15-
# from requests.adapters import HTTPAdapter
16-
# from requests.packages.urllib3.util.retry import Retry
15+
import contentstack
1716

1817

1918
def get_os_platform():
@@ -54,10 +53,14 @@ def get(self, url):
5453
We use requests.get method since we are sending a GET request.
5554
The four arguments we pass are url, verify(ssl), timeout, headers
5655
"""
57-
5856
try:
5957
self.headers.update(user_agents())
60-
response = requests.get(url, verify=True, timeout=(10, 8), headers=self.headers)
58+
# session = requests.Session()
59+
# retry = Retry(connect=3, backoff_factor=0.5)
60+
# adapter = HTTPAdapter(max_retries=retry)
61+
# session.mount('https://', adapter)
62+
# response = session.get(url, verify=True, headers=self.headers)
63+
response = requests.get(url, verify=True, headers=self.headers)
6164
response.encoding = 'utf-8'
6265
return response.json()
6366
except Timeout:

contentstack/utility.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"""
77

88
# ************* Module utility checked using pylint **************
9-
# Your code has been rated at 10.00/10 (previous run: 10.00/10, +0.00)
9+
# Your code has been rated at 10.00/10
1010

1111

1212
import json

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
22
"name": "contentstack.python",
3-
"version": "1.1.0"
3+
"version": "1.2.0"
44
}

0 commit comments

Comments
 (0)