In two cases (generating a new slug and editing the slug)
it is nice to know in advance (before the db gets angry)
that the slug is used/free. So created a db utility
function to check for this on mongo and sql:
check_media_slug_used()
attachments working with the sql backend.
- SQL Schema for attachment files, ordering attachments by
their name, not by the submission order (as earlier).
- Dot-Notation for attachments, where missing.
- convert existing attachments over from mongo -> sql
After a bit of discussion, we decided to drop the
pre-rendered html from the database and render it on
the fly.
In another step, we will use some proper caching method to
cache this stuff.
This commit affects the MediaEntry.description_html part.
After a bit of discussion, we decided to drop the
pre-rendered html from the database and render it on
the fly.
In another step, we will use some proper caching method to
cache this stuff.
This commit affects the User.bio_html part.
These changes allow all of the rest of the code to use tags
in sql as they were used on mongo. It's not efficient at
all, as changing tags usually means to remove all old tags
and adding all new.
The only problem here is: Old slugs for tags are not
removed, because they're shared across all MediaTags and
dropping orphans is not always easy.
Note: Migrations can't use "Dot Notation"!
Migrations run on pymongo, not mongokit.
So they can't use the "Dot Notation".
This isn't really a big issue, as migrations are anyway
quite mongo specific.
* Removed trailing whitespace
* Line length < 80 where possible
* Honor conventions on number of blank lines
* Honor conventions about spaces around :, =
Some places used to generate the URL for a media entry on
their own instead of calling media.url_for_self() to do
that. The later handles missing slugs better.
- adds a function to convert the tag list of dicts to a text string
properly delimited for loading into forms
- tag string conversion function updated to generate list of dicts
- updates all mentions of the conversion of the string to the tags db
object
- adds a tags template utility and updates the media template accordingly
- seems simpler to use the same tag field processing procedures on media
submit and edit, so now processing with a regular function instead of
a form filter. Filters run on form load and post by default.
- moved tags to sidebar
- taglist defaults to [] instead of None
- adds case sensitivity toggle
-before it was running the tags field through the submit filter.
that was kind of dumb
-removes the filter function from the edit form
-adds unicode syntax in the filter function
-uses split correctly when saving the edited tags to mongodb