forked from feincms/feincms
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfeatured.py
More file actions
27 lines (21 loc) · 695 Bytes
/
Copy pathfeatured.py
File metadata and controls
27 lines (21 loc) · 695 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
"""
Add a "featured" field to objects so admins can better direct top content.
"""
from __future__ import absolute_import, unicode_literals
from django.db import models
from django.utils.translation import ugettext_lazy as _
from feincms import extensions
class Extension(extensions.Extension):
def handle_model(self):
self.model.add_to_class(
'featured',
models.BooleanField(
_('featured'),
default=False,
),
)
def handle_modeladmin(self, modeladmin):
modeladmin.add_extension_options(_('Featured'), {
'fields': ('featured',),
'classes': ('collapse',),
})