Skip to content
Snippets Groups Projects
Commit c7e271be authored by Alexis  Clément's avatar Alexis Clément
Browse files

Modification of classes inheritance in README.md

parent 3578eb59
No related branches found
No related tags found
No related merge requests found
* Webu (webu.coop) https://github.com/webu * Webu (webu.coop) https://github.com/webu
* Dylann CORDEL <d.cordel@webu.coop> https://github.com/dylannCordel * Dylann CORDEL <d.cordel@webu.coop> https://github.com/dylannCordel
* Olivier Le Brouster <o.lebrouster@webu.coop> * Olivier Le Brouster <o.lebrouster@webu.coop>
* Alexis CLEMENT <a.clement@webu.coop> https://github.com/herawo
...@@ -28,8 +28,9 @@ newsbox_i18n, add those too. ...@@ -28,8 +28,9 @@ newsbox_i18n, add those too.
For basic news, you just have to inherit from NewsboxCMSBase : For basic news, you just have to inherit from NewsboxCMSBase :
from newsbox_cms.models import NewsboxCMSBase from newsbox_cms.models import NewsboxCMSBase
from newsbox.models import NewsboxBase
class News(NewsboxCMSBase): class News(NewsboxCMSBase, NewsboxBase):
class Meta: class Meta:
newsbox_detail_url_name = "news_detail" # optional newsbox_detail_url_name = "news_detail" # optional
...@@ -64,18 +65,17 @@ For the plugin, you just have to inherit from NewsboxPluginBase : ...@@ -64,18 +65,17 @@ For the plugin, you just have to inherit from NewsboxPluginBase :
newsbox_model = News newsbox_model = News
### cms_app.py ### cms_apps.py
Nothing special here. Just create your basic cms app : Nothing special here. Just create your basic cms app :
from cms.app_base import CMSApp from cms.app_base import CMSApp
from cms.apphook_pool import apphook_pool from cms.apphook_pool import apphook_pool
@apphook_pool.register
class NewsApphook(CMSApp): class NewsApphook(CMSApp):
name = _("News") name = _("News")
urls = ["myproject.news_urls"] urls = ["myproject.news_urls"]
apphook_pool.register(NewsApphook)
### news_urls.py ### news_urls.py
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment