Skip to content

Commit 06de88f

Browse files
Update Docs
1 parent 9829807 commit 06de88f

File tree

6 files changed

+26
-7
lines changed

6 files changed

+26
-7
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
<img alt="GitHub Workflow Status" src="https://github.com/py-package/masonite-instant-articles/actions/workflows/python-package.yml/badge.svg">
1010
<img alt="PyPI" src="https://img.shields.io/pypi/v/masonite-instant-article">
11-
<img src="https://img.shields.io/badge/python-3.7+-blue.svg" alt="Python Version">
11+
<img src="https://img.shields.io/badge/python-3.8+-blue.svg" alt="Python Version">
1212
<img alt="GitHub release (latest by date including pre-releases)" src="https://img.shields.io/github/v/release/py-package/masonite-instant-articles">
1313
<img alt="License" src="https://img.shields.io/github/license/py-package/masonite-instant-articles">
1414
<a href="https://github.com/py-package/masonite-instant-article/stargazers"><img alt="star" src="https://img.shields.io/github/stars/py-package/masonite-instant-articles" /></a>

masonite.sqlite3

24 KB
Binary file not shown.

setup.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
# Versions should comply with PEP440. For a discussion on single-sourcing
99
# the version across setup.py and the project code, see
1010
# https://packaging.python.org/en/latest/single_source_version.html
11-
version='0.1.1',
11+
version='0.1.2',
1212
packages=[
1313
'instant_article',
1414
'instant_article.config',
@@ -45,7 +45,6 @@
4545

4646
# Specify the Python versions you support here. In particular, ensure
4747
# that you indicate whether you support Python 2, Python 3 or both.
48-
'Programming Language :: Python :: 3.7',
4948
'Programming Language :: Python :: 3.8',
5049
'Programming Language :: Python :: 3.9',
5150
'Programming Language :: Python :: 3.10',

src/instant_article/models/instant_article_resolver.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ def to_response(self) -> Response:
4949
def _resolve_items(self, resolver):
5050
try:
5151
module = importlib.import_module(resolver)
52-
5352
model = getattr(module, resolver.split(".")[-1])
5453

5554
items = []

tests/integrations/app/models/User.py

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,32 @@
22
from masoniteorm.models import Model
33
from masoniteorm.scopes import SoftDeletesMixin
44
from masonite.authentication import Authenticates
5+
from src.instant_article.interfaces.instant_article_interface import InstantArticleInterface
6+
from src.instant_article.models.instant_article import InstantArticle
57

68

7-
class User(Model, SoftDeletesMixin, Authenticates):
9+
class User(Model, SoftDeletesMixin, Authenticates, InstantArticleInterface):
810
"""User Model."""
911

1012
__fillable__ = ["name", "email", "password"]
1113
__hidden__ = ["password"]
1214
__auth__ = "email"
15+
16+
@staticmethod
17+
def get_feed_items():
18+
return User.all() # can be any query returning proper values
19+
20+
def format_feed(self):
21+
return InstantArticle.create({
22+
'id': self.id, # required | integer
23+
'title': self.name, # required | string
24+
'subtitle': '', # nullable | string
25+
'kicker': '', # nullable | string
26+
'summary': '', # required | string
27+
'description': '', # required | string
28+
'cover': '', # nullable | string
29+
'updated': self.updated_at, # required | date
30+
'published': self.created_at, # required | date
31+
'link': '', # full url to item...
32+
'author': '' # nullable | email | string
33+
})

tests/integrations/config/instant_article.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
INSTANT_ARTICLE = {
1414
"force_validate": False,
1515
"feed_details": {
16-
"route-name.xml": {
17-
"model": "app.models.User",
16+
"users.xml": {
17+
"model": "tests.integrations.app.models.User",
1818
"title": "",
1919
"description": "",
2020
"lang": "en-us",

0 commit comments

Comments
 (0)