# Path: flask_editablesite/database.py
# class CRUDMixin(object):
# class Model(CRUDMixin, db.Model):
# class SurrogatePK(object):
# class Slugged(object):
# class TimeStamped(object):
# class Confirmable(object):
#     def create(cls, **kwargs):
#     def update(self, commit=True, **kwargs):
#     def save(self, commit=True):
#     def delete(self, commit=True):
#     def get_by_id(cls, id):
# def ReferenceCol(tablename, nullable=False, pk_name='id', **kwargs):
#     def validate_slug(self, key, value):
# def update_slug_before_save(mapper, connection, target):
#     def created_at_formatted(self):
#     def updated_at_formatted(self):
# def update_timestamps_before_insert(mapper, connection, target):
# def update_timestamps_before_update(mapper, connection, target):
#     def confirmed_at_formatted(self):
# def update_confirmedat_before_save(mapper, connection, target):


from sqlalchemy import event
from slugify import slugify
from flask import current_app as app
from flask import url_for
from flask_editablesite.database import (
    Column,
    db,
    Model,
    SurrogatePK,
    Slugged,
    TimeStamped,
    Confirmable,
    update_slug_before_save,
    update_timestamps_before_insert,
    update_timestamps_before_update,
    update_confirmedat_before_save,
)
        ret[slug] = cls(title=title, slug=slug, content=(
            '<p>The aim of this app is to demonstrate that, with the '
            'help of modern JS libraries, and with some well-'
            'thought-out server-side snippets, it\'s now perfectly '
            'possible to "bake in" live in-place editing for '
            'virtually every content element in a typical '
            'brochureware site.</p>'),
            active=True)

        title = 'About text (right column)'
        slug = slugify(title, to_lower=True)
        ret[slug] = cls(title=title, slug=slug, content=(
            '<p>This app is not a CMS. On the contrary, think of it '
            'as a proof-of-concept alternative to a CMS. An '
            'alternative where there\'s no "admin area", there\'s '
            'no "editing mode", and there\'s no "preview '
            'button".</p>'),
            active=True)

        title = 'About text (below columns)'
        slug = slugify(title, to_lower=True)
        ret[slug] = cls(
            title=title, slug=slug,
            content="<p>There's only direct manipulation.</p>",
            active=True)

        return ret


event.listen(RichTextContentBlock, 'before_insert',

# Path: flask_editablesite/database.py
# class CRUDMixin(object):
# class Model(CRUDMixin, db.Model):
# class SurrogatePK(object):
# class Slugged(object):
# class TimeStamped(object):
# class Confirmable(object):
#     def create(cls, **kwargs):
#     def update(self, commit=True, **kwargs):
#     def save(self, commit=True):
#     def delete(self, commit=True):
#     def get_by_id(cls, id):
# def ReferenceCol(tablename, nullable=False, pk_name='id', **kwargs):
#     def validate_slug(self, key, value):
# def update_slug_before_save(mapper, connection, target):
#     def created_at_formatted(self):
#     def updated_at_formatted(self):
# def update_timestamps_before_insert(mapper, connection, target):
# def update_timestamps_before_update(mapper, connection, target):
#     def confirmed_at_formatted(self):
# def update_confirmedat_before_save(mapper, connection, target):


# Path: flask_editablesite/contentblock/models.py
from sqlalchemy import event
from slugify import slugify
from flask import current_app as app
from flask import url_for
from flask_editablesite.database import (
    Column,
    db,
    Model,
    SurrogatePK,
    Slugged,
    TimeStamped,
    Confirmable,
    update_slug_before_save,
    update_timestamps_before_insert,
    update_timestamps_before_update,
    update_confirmedat_before_save,
)

        ret[slug] = cls(title=title, slug=slug, content=(
            '<p>The aim of this app is to demonstrate that, with the '
            'help of modern JS libraries, and with some well-'
            'thought-out server-side snippets, it\'s now perfectly '
            'possible to "bake in" live in-place editing for '
            'virtually every content element in a typical '
            'brochureware site.</p>'),
            active=True)

        title = 'About text (right column)'
        slug = slugify(title, to_lower=True)
        ret[slug] = cls(title=title, slug=slug, content=(
            '<p>This app is not a CMS. On the contrary, think of it '
            'as a proof-of-concept alternative to a CMS. An '
            'alternative where there\'s no "admin area", there\'s '
            'no "editing mode", and there\'s no "preview '
            'button".</p>'),
            active=True)

        title = 'About text (below columns)'
        slug = slugify(title, to_lower=True)
        ret[slug] = cls(
            title=title, slug=slug,
            content="<p>There's only direct manipulation.</p>",
            active=True)

        return ret


event.listen(RichTextContentBlock, 'before_insert',

             update_timestamps_before_insert)