Skip to content

Commit

Permalink
Merge pull request nkrkv#24 from knopki/feat-articles-pagination
Browse files Browse the repository at this point in the history
Паджинация списка статей в блогах
  • Loading branch information
nkrkv authored Feb 13, 2023
2 parents d984987 + 87c218d commit 97783cb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions insales/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -471,8 +471,10 @@ def delete_blog(self, blog_id):
#========================================================================
# Статьи (в блоге)
#========================================================================
def get_articles(self, blog_id):
return self._get('/admin/blogs/%s/articles.xml' % blog_id)
def get_articles(self, blog_id, per_page = 10, page = 1):
"Get orders: https://api.insales.ru/?doc_format=XML#article-get-articles-list-xml"
qargs = {"per_page": per_page, "page": page}
return self._get('/admin/blogs/%s/articles.xml' % blog_id, qargs) or []

def get_article(self, blog_id, article_id):
return self._get('/admin/blogs/%s/articles/%s.xml' % (blog_id, article_id))
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

setup(
name='pyinsales',
version='1.7.0',
version='1.8.0',
description='InSales e-commerce platform API bindings',
long_description=readme_content,
long_description_content_type="text/markdown",
Expand Down

0 comments on commit 97783cb

Please sign in to comment.