No more clicking individual sections to edit them. From now on, there will
only be one edit button! The biggest challenge was getting the javascript
closures to understand.
context, as provided by the polymorphic subsection's registered view.
Also, I'm trying to move all the website-related cruft from cms into the
example project, so that only the Page and Section models with their own
"admin" views will remain.
Each custom section can now have their own associated custom SectionView.
SectionView subclasses behave just like Django's generic views, except they
return Section objects instead of http responses. The updated PageView takes
care of compositing all rendered sections into the final response. Nice!
Oh boy! This is a big one. Two new dependencies: swapper and
django-polymorphic will now allow any project that uses cms to elegantly
extend the default Section model with custom fields and custom subclasses.
This is still a work in progress.
First, extend BasePageView and add stuff to the context that your sections
need. Second, create a URLConf entry pointing to your new class. Third,
extend the base.html nav block and change the {% url cms:page %} to its new
name.
It seems so easy in hindsight...
a functioning Python module without editing settings.py and customizing
the PROJECT_NAME variable.
Also, some small CSS tweaks and a rewrite of README.md
These apps are so minimal they don't warrant their own repository. I'm
hoping they will find a new home here. This move kind of obsoletes the
github.com/rtts/django-numberedmodel and github.com/rtts/django-simplesass
repositories, although I'm not planning to update their documentation unless
I make any major changes here.
Since all of my django projects usually end up with a very similar
structure, I thought it would be useful to include some common settings in
this repository. This is useful for testig the cms app, but also as a
scaffold for new projects. The syntax in settings.py is intentionally
invalid, so you will have to make your desired changes before you can
actually use it.
My personal intended usecase: use this repository as a template for new
projects, edit settings.py and add custom apps.