coaster
coaster copied to clipboard
Common patterns for Flask apps
The `make_name` function is used to generate URL slugs in two distinct scenarios: 1. To generate a nice URL for some content where the exact URL doesn't matter as long...
In the process of defining abstractions around our core data models, we've arrived on the following three: 1. **Documents**, which are the concern of the mixin classes provided in `coaster.sqlalchemy`....
Coaster needs a decorator that supports caching with the [ETag header](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/ETag). A regular Flask-Cache cache decorator will save server processing time, but not bandwidth consumption for the client. [This example...
The `Registry` class and `RegistryMixin` mixin were added in #207 as a way to simplify retrieval of forms and views, without needing imports. They have since found utility in templates...
1. Allowing externally hosted images creates an information leak wherein the external host receives traffic from users, revealing their IP, browser info and referrer. Some use cases may also require...
For performance reasons, apps like Hasjob in production should have separate master and replica databases, running on different nodes: 1. All writes happen on the master database 2. All reads...
The [Zine typography plugin (@jace's branch)](https://bitbucket.org/jace/zine-main/src/a344905553f8bbd9edb3db81ff983fa8c8637259/zine/plugins/typography/__init__.py?at=default&fileviewer=file-view-default) offers better accuracy than Smartypants. Since it parses HTML and not markdown, it can be applied on both markdown and richtext fields. Consider this...
py.test tests are much nicer to read. [unittest2pytest](https://github.com/pytest-dev/unittest2pytest) provides an automated test re-writer that can handle the bulk of the task. Setting up fixtures correctly will take a bit more...
Baseframe currently supplies a JSON Encoder that is used for objects from Coaster. It makes sense to host the encoder in Coaster itself, to sync maintenance, and use a subclass...
The current "immutable" and "cached" annotations are used to indicate database columns that are read-only and holding disposable values, respectively. We need one or two more annotations: 1. "temporary": indicating...