FeinCMS add-on which adds extra admin Page validation
Project description
=============================
feincms-bounds
=============================
.. image:: https://travis-ci.org/marcofucci/feincms-bounds.png?branch=master
:target: https://travis-ci.org/marcofucci/feincms-bounds
FeinCMS add-on which adds extra admin Page validation:
- Unique templates: templates that can be used only once (e.g. home page)
- First-Level-Only templates: templates that can be used in the first level - of navigation only (e.g. home page)
- No-Children templates: templates that can't have subpages (e.g. home page)
- Level of Navigation: max levels of navigation allowed
Quickstart
----------
Install feincms-bounds::
pip install feincms-bounds
Add feincms-bounds to your ``settings.INSTALLED_APPS``::
INSTALLED_APPS = (
...
'feincms_bounds',
...
)
When registering a FeinCMS template, use ``feincms_bounds.models.Template``
and specify whether it's unique, first-level only or can't have subpages.
In ``models.py``::
from feincms.module.page.models import Page
from feincms_bounds.models import Template
Page.register_templates(
Template(
key='internalpage',
title='Internal Page',
path='pages/internal.html',
regions=(
('main', 'Main Content'),
('sidebar', 'Sidebar'),
)
), Template(
key='homepage',
title='Home Page',
path='pages/home_page.html',
regions=(
('main', 'Main Content'),
),
# new kwargs introduced by feincms-bounds
unique=True,
first_level_only=True,
no_children=True
)
)
Finally, use ``feincms_bounds.admin.PageAdmin`` when registering the Page
(you need to unregister the feinCMS default one first).
In ``admin.py``::
from django.contrib import admin
from feincms.module.page.models import Page
from feincms_bounds.admin import PageAdmin
# We have to unregister it, and then reregister
admin.site.unregister(Page)
admin.site.register(Page, PageAdmin)
Optionally, you can specify a max level of navigation using ``settings.FEINCMS_NAVIGATION_LEVEL``.
Done! You can now take advantage of the extra admin Page validation provided by
feincms-bounds.
Example
-------
* Sample project: https://github.com/marcofucci/feincms_extended
* Original Blog: http://www.marcofucci.com/tumblelog/19/may/2010/customizing-feincms-part-1/
History
-------
0.1.0 (2013-10-07)
++++++++++++++++++
* Version 0.1.0
feincms-bounds
=============================
.. image:: https://travis-ci.org/marcofucci/feincms-bounds.png?branch=master
:target: https://travis-ci.org/marcofucci/feincms-bounds
FeinCMS add-on which adds extra admin Page validation:
- Unique templates: templates that can be used only once (e.g. home page)
- First-Level-Only templates: templates that can be used in the first level - of navigation only (e.g. home page)
- No-Children templates: templates that can't have subpages (e.g. home page)
- Level of Navigation: max levels of navigation allowed
Quickstart
----------
Install feincms-bounds::
pip install feincms-bounds
Add feincms-bounds to your ``settings.INSTALLED_APPS``::
INSTALLED_APPS = (
...
'feincms_bounds',
...
)
When registering a FeinCMS template, use ``feincms_bounds.models.Template``
and specify whether it's unique, first-level only or can't have subpages.
In ``models.py``::
from feincms.module.page.models import Page
from feincms_bounds.models import Template
Page.register_templates(
Template(
key='internalpage',
title='Internal Page',
path='pages/internal.html',
regions=(
('main', 'Main Content'),
('sidebar', 'Sidebar'),
)
), Template(
key='homepage',
title='Home Page',
path='pages/home_page.html',
regions=(
('main', 'Main Content'),
),
# new kwargs introduced by feincms-bounds
unique=True,
first_level_only=True,
no_children=True
)
)
Finally, use ``feincms_bounds.admin.PageAdmin`` when registering the Page
(you need to unregister the feinCMS default one first).
In ``admin.py``::
from django.contrib import admin
from feincms.module.page.models import Page
from feincms_bounds.admin import PageAdmin
# We have to unregister it, and then reregister
admin.site.unregister(Page)
admin.site.register(Page, PageAdmin)
Optionally, you can specify a max level of navigation using ``settings.FEINCMS_NAVIGATION_LEVEL``.
Done! You can now take advantage of the extra admin Page validation provided by
feincms-bounds.
Example
-------
* Sample project: https://github.com/marcofucci/feincms_extended
* Original Blog: http://www.marcofucci.com/tumblelog/19/may/2010/customizing-feincms-part-1/
History
-------
0.1.0 (2013-10-07)
++++++++++++++++++
* Version 0.1.0
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
feincms-bounds-0.1.0.tar.gz
(7.7 kB
view details)
File details
Details for the file feincms-bounds-0.1.0.tar.gz
.
File metadata
- Download URL: feincms-bounds-0.1.0.tar.gz
- Upload date:
- Size: 7.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 151280a64d1146f50c1e991c1199636af07838576e010bb87ceceaaf4bc3ba13 |
|
MD5 | faafc90152e6b53eac44dc3972787a93 |
|
BLAKE2b-256 | ae49196262d9be8361fd5c5aa470ac803190582da1674409c71e5d80d4a3a889 |