class CategoryBundle(bundles.Bundle): navigation = bundles.PARENT main = views.ListView(paginate_by = 1, display_fields=('category',), change_fields=('category',)) class Meta: model = Category primary_model_bundle = True
class TagBundle(bundles.Bundle): navigation = bundles.PARENT main = views.ListView(paginate_by = 1, display_fields=('tag',), change_fields=('tag',)) class Meta: model = Tag primary_model_bundle = True
class BlogBundle(bundles.DelegatedObjectBundle): dashboard = ( ('main',), ('author',), ('dummy_alias',), ('dummy_redirector',), ('category',), ('tag',), ) main = views.ListView(display_fields=('title', 'author')) delete = actions.DeleteActionView() add = PostAddView(fieldsets=DEFAULT_FIELDS) edit = BlogEditBundle.as_subbundle(name='post', title="Post") author = AuthorBundle.as_subbundle(name='author', title='Author') dummy_alias = DummyAliasBundle.as_subbundle(name='dummy_alias', title='Dummy Alias') dummy_redirector = DummyRedirectorBundle.as_subbundle(name='dummy_redirector', title='Dummy Redirect') category = CategoryBundle.as_subbundle(name='category', title='Category') tag = TagBundle.as_subbundle(name='tag', title='Tag') preview = views.PreviewWrapper(preview_view=PostsListView, pass_through_kwarg=None) change = DummyActionView(short_description="Change names to 'Dummy'") clone = CloneAction() class Meta: model = Post primary_model_bundle = True item_views = list(options.VersionMeta.item_views) + ['preview'] action_views = ['change', 'delete', 'clone']
class AuthorBundle(bundles.Bundle): navigation = bundles.PARENT edit = views.FormView(form_class=EditAuthorForm) main = views.ListView(filter_form = forms.search_form('name', 'bio',)) class Meta: model = Author
class FeedbackBundle(bundles.Bundle): dashboard = (('email', 'text'), ) main = views.ListView(paginate_by=20) class Meta: model = models.Feedback
class CommentBundle(bundles.ParentVersionedBundle, bundles.VersionMixin): navigation = bundles.PARENT object_view = bundles.PARENT clone = CloneCommentAction() main = views.ListView(display_fields=('name', 'text')) something = SomethingAction() class Meta: model = Comment parent_field = "post" action_views = ['delete', 'clone', 'something', 'publish', 'unpublish']
class TestMainBundle(bundles.Bundle): navigation = bundles.PARENT main = views.ListView(display_fields=('user', 'text')) class Meta: primary_model_bundle = True