Skip to content

Commit

Permalink
Update Docs
Browse files Browse the repository at this point in the history
  • Loading branch information
yubarajshrestha committed Jul 16, 2022
1 parent 9829807 commit 06de88f
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 7 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

<img alt="GitHub Workflow Status" src="https://github.com/py-package/masonite-instant-articles/actions/workflows/python-package.yml/badge.svg">
<img alt="PyPI" src="https://img.shields.io/pypi/v/masonite-instant-article">
<img src="https://img.shields.io/badge/python-3.7+-blue.svg" alt="Python Version">
<img src="https://img.shields.io/badge/python-3.8+-blue.svg" alt="Python Version">
<img alt="GitHub release (latest by date including pre-releases)" src="https://img.shields.io/github/v/release/py-package/masonite-instant-articles">
<img alt="License" src="https://img.shields.io/github/license/py-package/masonite-instant-articles">
<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>
Expand Down
Binary file added masonite.sqlite3
Binary file not shown.
3 changes: 1 addition & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
# Versions should comply with PEP440. For a discussion on single-sourcing
# the version across setup.py and the project code, see
# https://packaging.python.org/en/latest/single_source_version.html
version='0.1.1',
version='0.1.2',
packages=[
'instant_article',
'instant_article.config',
Expand Down Expand Up @@ -45,7 +45,6 @@

# Specify the Python versions you support here. In particular, ensure
# that you indicate whether you support Python 2, Python 3 or both.
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
Expand Down
1 change: 0 additions & 1 deletion src/instant_article/models/instant_article_resolver.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ def to_response(self) -> Response:
def _resolve_items(self, resolver):
try:
module = importlib.import_module(resolver)

model = getattr(module, resolver.split(".")[-1])

items = []
Expand Down
23 changes: 22 additions & 1 deletion tests/integrations/app/models/User.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,32 @@
from masoniteorm.models import Model
from masoniteorm.scopes import SoftDeletesMixin
from masonite.authentication import Authenticates
from src.instant_article.interfaces.instant_article_interface import InstantArticleInterface
from src.instant_article.models.instant_article import InstantArticle


class User(Model, SoftDeletesMixin, Authenticates):
class User(Model, SoftDeletesMixin, Authenticates, InstantArticleInterface):
"""User Model."""

__fillable__ = ["name", "email", "password"]
__hidden__ = ["password"]
__auth__ = "email"

@staticmethod
def get_feed_items():
return User.all() # can be any query returning proper values

def format_feed(self):
return InstantArticle.create({
'id': self.id, # required | integer
'title': self.name, # required | string
'subtitle': '', # nullable | string
'kicker': '', # nullable | string
'summary': '', # required | string
'description': '', # required | string
'cover': '', # nullable | string
'updated': self.updated_at, # required | date
'published': self.created_at, # required | date
'link': '', # full url to item...
'author': '' # nullable | email | string
})
4 changes: 2 additions & 2 deletions tests/integrations/config/instant_article.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
INSTANT_ARTICLE = {
"force_validate": False,
"feed_details": {
"route-name.xml": {
"model": "app.models.User",
"users.xml": {
"model": "tests.integrations.app.models.User",
"title": "",
"description": "",
"lang": "en-us",
Expand Down

0 comments on commit 06de88f

Please sign in to comment.