From 06de88f68d04cf866ca9484effe3bb75a6e0ad4c Mon Sep 17 00:00:00 2001 From: Yubaraj Shrestha Date: Sun, 17 Jul 2022 00:08:29 +0545 Subject: [PATCH] Update Docs --- README.md | 2 +- masonite.sqlite3 | Bin 0 -> 24576 bytes setup.py | 3 +-- .../models/instant_article_resolver.py | 1 - tests/integrations/app/models/User.py | 23 +++++++++++++++++- tests/integrations/config/instant_article.py | 4 +-- 6 files changed, 26 insertions(+), 7 deletions(-) create mode 100644 masonite.sqlite3 diff --git a/README.md b/README.md index 0530afa..5dc40a8 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ GitHub Workflow Status PyPI - Python Version + Python Version GitHub release (latest by date including pre-releases) License star diff --git a/masonite.sqlite3 b/masonite.sqlite3 new file mode 100644 index 0000000000000000000000000000000000000000..4ccf7bd121b4f0dafd30cb721c6b5a2a7302140e GIT binary patch literal 24576 zcmeI)-%r{=00;0ZAkGCsqI+0N3-M^5d^YE zDIp|!`{SD+g!wvh8}~OtM|@B;O6If|W3lICX!M4}UXGLTpQATpKL%yTaR@*F0uX=z z1Rwwb2teRL1g_1kaO zE3~+$(qgGln4yW9Zm|SCl9b%Gq$D#73#rajX6a^iaB^LD-3!~{H4m!5Wfi+-XoE7g zuEAjzv&ziTJo`PX^;Xu(Q$M$Be_UuQ=_7N@Q>#0lu8Aa=1Php7geoYl(RJI#y^xYSe5lX*9^_=6%SQK;yplvF40V`;+U51 ze4_hGepgaX=xh0eCQTzXLrcZ{K}k*q{HauGC>mdl3&gA$tm%HJ@+Uk^Z+LdFueGWZ zgH816Ff<&Wo)*5m4Ti;?yXG*Ld2Y{cxO=Gdr22#AFa6)QzwXBtYt~JE;-Fu;=s9rz zZfTe823QS8;|J4&0D7)l6MGK$54lhLo9^nJFdUzp6s|`D9Lqd&bkDSF?tLuOO>&>$ zYqa-x=k>jr+8KJsaJyZJvhG#R`xWjOAnj^gtsNaWUOIE6Qe(WCq1ZPP`_5Mg5P$## zAOHafKmY;|fB*y_009X6FM(tzLP{frVv#y-k z&Ya!T99mGsfBxq${ShDl0SG_<0uX=z1Rwwb2tWV=5O~A_PyM#x`Tr63Fq#Gd2tWV= z5P$##AOHafKmY;|AjE(FFT_3*z92vV0uX=z1Rwwb2tWV=5P$##An@=4S0Q1HOw3*l z`Bi7LWXBG^%CW|px>c{Txr%K~Wy(`xdg}N{tg>@`p{X{Eo$cLxVX=O!@10(3Zn5(E zytH)jW^QNStu3oeGSsci<)xY4p5uQJ$jqjfX2nG+zFHB}E8 Response: def _resolve_items(self, resolver): try: module = importlib.import_module(resolver) - model = getattr(module, resolver.split(".")[-1]) items = [] diff --git a/tests/integrations/app/models/User.py b/tests/integrations/app/models/User.py index 5c1056f..a05f7a6 100644 --- a/tests/integrations/app/models/User.py +++ b/tests/integrations/app/models/User.py @@ -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 + }) diff --git a/tests/integrations/config/instant_article.py b/tests/integrations/config/instant_article.py index 804c953..41dbd1b 100644 --- a/tests/integrations/config/instant_article.py +++ b/tests/integrations/config/instant_article.py @@ -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",