Revision 7c981632 cloudcms/cms.py

b/cloudcms/cms.py
54 54
from feincms.content.video.models import VideoContent
55 55
from feincms.content.richtext.models import RichTextContent
56 56

  
57
from cloudcmsblog.models import Entry, LatestEntries
58
from cloudcmsfaq.models import Question
59

  
60 57
from cloudcmsresources.models import ResourcesList
61 58
from cloudcms.content import *
62 59

  
......
120 117
        ),
121 118
    },
122 119
    {
120
    'key': 'faq',
121
    'title': 'FAQ\'s template',
122
    'path': 'cms/pages/faq.html',
123
    'regions': (
124
        ('main', 'Main region'),
125
        ('sidebar', 'Sidebar', 'inherited'),
126
        ),
127
    },
128
    {
123 129
    'key': 'raw',
124 130
    'title': 'Empty content template',
125 131
    'path': 'cms/pages/empty.html',
......
139 145
Page.create_content_type(TwitterFeed)
140 146
Page.create_content_type(VideoContent)
141 147
Page.create_content_type(VideoSection)
142
Page.create_content_type(LatestEntries)
143 148
Page.create_content_type(IntroButton)
144 149
Page.create_content_type(ImageContent, POSITION_CHOICES=(
145 150
    ('default', 'Default position'),
......
152 157
    ('cloudcmsblog', 'Cloud blog', {'urls': 'cloudcmsblog.urls'}),
153 158
    ('cloudcmsfaq', 'Cloud FAQ', {'urls': 'cloudcmsfaq.urls'}),))
154 159

  
155

  
156 160
# cloudcms specific content registration
157 161
Page.create_content_type(LoginForm)
158 162
Page.create_content_type(AboutBlock)
159 163
Page.create_content_type(ResourcesList)
160 164

  
161 165

  
166
# Extra cms applications
167
EXTRA_CONTENT_MODELS = []
168

  
169
if 'cloudcmsblog' in settings.INSTALLED_APPS:
170
    from cloudcmsblog.models import Entry, LatestEntries
171
    EXTRA_CONTENT_MODELS.append(Entry)
172
    Page.create_content_type(LatestEntries)
162 173

  
163
for model in [Entry, Question]:
174
if 'cloudcmsfaq' in settings.INSTALLED_APPS:
175
    from cloudcmsfaq.models import Question
176
    EXTRA_CONTENT_MODELS.append(Question)
177

  
178
for model in EXTRA_CONTENT_MODELS:
164 179
    # Feincms specific registrations for our blog entry model
165 180
    model.register_regions(
166 181
        ('main', _('Main content area')),
167 182
        ('sidebar', _('Right column')),
168 183
    )
169
    model.create_content_type(TemplateContent)
170 184
    model.create_content_type(RawContent)
185
    model.create_content_type(TemplateContent)
171 186
    model.create_content_type(SectionContent, TYPE_CHOICES=(('block', 'Block'),))
172 187
    model.create_content_type(RichTextContent, cleanse=False, regions=('main',))
188
    model.create_content_type(ImageContent, POSITION_CHOICES=(
189
        ('default', 'Default position'),
190
    ))
173 191

  

Also available in: Unified diff