Upgrading
For an overview of what has changed between versions, see the changelog.
Instructions
Check which version of Fastview you are upgrading from:
python >>> import fastview >>> fastview.__version__
Upgrade the Fastview package:
pip install --upgrade django-fastview
Find your version below and work your way up this document until you’ve upgraded to the latest version
Upgrading from 0.1.0
Template fragments
Any elements in the full page templates fastview/<action>.html
have been moved into
their fragments; they now just wrap fragments/<action>.html
with a base template.
The included template components in includes/<action>/
have been moved into
fragments/<action>/
.
Fragment templates have been broken into additional components in fragments/action/
for ease of customisation.
If you were overriding a section of a fragment template in fragments/
, or an include
in includes/
, you will want to move those changes into the appropriate files in
fragments/<action>/
For example, for fragments/list.html
:
the filter was in
includes/list/filter.html
; it is now infragments/list/filter.html
the data table was in
fragments/list.html
; it is now infragments/list/data.html
There is now a {% fragment_component <component> %}
template tag which honours
template searching logic - eg anywhere it will look for fragments/template.html
, it
will look for components in fragments/template/
.
Upgrading from 0.0.3
Permissions
Viewgroup permissions
are now managed through View.config
and the dict shortcut.
For example, change the old permission dict:
class BlogViewGroup(ModelViewGroup):
permissions = {
"index": Public(),
"detail": Public(),
}
to an explicit .config()
call, or a shortcut view configuration dict:
class BlogViewGroup(ModelViewGroup):
index_view = views.ListView.config(permission=Public())
detail_view = dict(permission=Public())
They can still be set directly as permission
on class definitions.
See permissions for more details.
Imports
The internal structure of Fastview’s modules has changed:
Renamed
fastview.groups
tofastview.viewgroups
Renamed
fastview.views.generics
tofastview.views.generic
Upgrading from 0.0.1
No changes required