Skip to content

Commit 54b24d4

Browse files
mshaileshr@gmail.commshaileshr@gmail.com
authored andcommitted
1.0.0
1 parent d078cc7 commit 54b24d4

File tree

6 files changed

+47
-16
lines changed

6 files changed

+47
-16
lines changed

changelog.rst

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
=========
2+
CHANGELOG
3+
=========
4+
5+
*Date: 18-Jun-2020 - initial release*
6+
7+
**v1.0.0**
8+
============
9+
10+
- **Stack**
11+
- Added support for whereIn(String key) and whereNotIn(String key) methods in Query
12+
13+
- **Assets**
14+
- changes for where function that accepts QueryOptions.
15+
16+
- **Entry**
17+
- changes for where function that accepts QueryOptions.
18+
19+
- **Query**
20+
- changes for where function that accepts QueryOptions.
21+
22+
23+
-----------------------------
24+
25+
*Date: 18-Nov-2019 - beta release*
26+
27+
**v0.0.1**
28+
============
29+
- Beta release for the contentstack-python SDK for Content Delivery API

contentstack/assetquery.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
"""
2-
This call fetches the list of all the assets of a particular stack.
1+
r"""This call fetches the list of all the assets of a particular stack.
32
It also returns the content of each asset in JSON format.
43
You can also specify the environment of which you wish to get the assets.
54
"""
@@ -27,10 +26,11 @@ def __init__(self, http_instance):
2726
self.base_url = "{}?{}".format(self.base_url, "environment={}".format(env))
2827

2928
def environment(self, environment):
30-
"""
31-
Provide the name of the environment if you wish to retrieve the assets published
29+
r"""Provide the name of the environment if you wish to retrieve the assets published
3230
in a particular environment.
31+
3332
:param environment: environment of the stack
33+
3434
:return: AssetQuery - so we can chain the call
3535
3636
-----------------------------
@@ -45,12 +45,12 @@ def environment(self, environment):
4545
return self
4646

4747
def version(self, version):
48-
"""
49-
Specify the version number of the asset that you wish to retrieve.
48+
r"""Specify the version number of the asset that you wish to retrieve.
5049
If the version is not specified, the details of the latest version will be retrieved.
5150
To retrieve a specific version, keep the environment parameter blank.
5251
5352
:param version: version number of the asset that you wish to retrieve
53+
5454
:return: AssetQuery: so we can chain the call
5555
5656
-----------------------------
@@ -65,9 +65,9 @@ def version(self, version):
6565
return self
6666

6767
def include_dimension(self):
68-
"""
69-
include the dimensions (height and width) of the image in the response.
68+
r"""Include the dimensions (height and width) of the image in the response.
7069
Supported image types: JPG, GIF, PNG, WebP, BMP, TIFF, SVG, and PSD
70+
7171
:return: AssetQuery: so we can chain the call
7272
7373
-----------------------------
@@ -82,8 +82,8 @@ def include_dimension(self):
8282
return self
8383

8484
def relative_url(self):
85-
"""
86-
include the relative URLs of the assets in the response.
85+
r"""include the relative URLs of the assets in the response.
86+
8787
:return: AssetQuery: so we can chain the call
8888
8989
-----------------------------
@@ -98,11 +98,11 @@ def relative_url(self):
9898
return self
9999

100100
def find(self):
101-
"""
102-
This call fetches the list of all the assets of a particular stack.
101+
r"""This call fetches the list of all the assets of a particular stack.
103102
It also returns the content of each asset in JSON format.
104103
Learn more about Assets
105104
[https://www.contentstack.com/docs/content-managers/work-with-assets].
105+
106106
:return: json result, List of asset object
107107
108108
-----------------------------

contentstack/basequery.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ def where(self, field_uid: str, query_operation: QueryOperation, fields=None):
5050
Get entries containing the field values matching the condition in the query.
5151
Arguments:
5252
field_uid {str} -- [accept field uid for the operation]
53-
query_operation {QueryOperation} -- [Type of operation to perform]
53+
query_operation {QueryOperation} -- Type of operation to perform
5454
fields {list} - list of string
5555
"""
5656
if None not in (field_uid, query_operation):

contentstack/contenttype.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,10 @@ def entry(self, entry_uid: str):
4242
>>> entry = content_type.entry(uid='entry_uid')
4343
--------------------------------
4444
"""
45-
if None in (self.__content_type_uid, entry_uid):
46-
raise KeyError('Please provide valid content_type_uid and entry uid')
45+
if self.__content_type_uid is None:
46+
raise PermissionError('Please provide valid content_type_uid')
47+
elif entry_uid is None:
48+
raise PermissionError('Please provide valid entry uid')
4749
entry = Entry(self.http_instance, self.__content_type_uid, entry_uid=entry_uid)
4850
return entry
4951

examples/__init__.py

Whitespace-only changes.

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
"application frontend, and Contentstack will take care of the rest",
3030
long_description_content_type="text/markdown",
3131
url="https://github.com/contentstack/contentstack-python",
32-
#packages=setuptools.find_packages(),
32+
# packages=setuptools.find_packages(),
3333
packages=['contentstack'],
3434
license='MIT',
3535
test_suite='tests.all_tests',

0 commit comments

Comments
 (0)