Skip to content

Commit

Permalink
Merge pull request #3 from moorinteractive/select
Browse files Browse the repository at this point in the history
Prevent migrating this app, use Select widget instead
  • Loading branch information
robmoorman authored Sep 12, 2016
2 parents 62615ea + ab2bc50 commit 78b021e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/wagtailthemes/models.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
from django import forms
from django.conf import settings
from django.db import models
from wagtail.contrib.settings.models import BaseSetting, register_setting
from wagtail.wagtailadmin.edit_handlers import FieldPanel


__ALL__ = ['ThemeSettings']


@register_setting
class ThemeSettings(BaseSetting):
THEMES = getattr(settings, 'WAGTAIL_THEMES', None)

theme = models.CharField(
blank=True, choices=THEMES, max_length=255, null=True)
theme = models.CharField(blank=True, max_length=255, null=True)

panels = [
FieldPanel('theme', widget=forms.Select(choices=THEMES))
]
1 change: 1 addition & 0 deletions src/wagtailthemes/thread.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
def set_theme(theme):
setattr(_thread_locals, 'wagtail_theme', theme)


def get_theme():
theme = getattr(_thread_locals, 'wagtail_theme', None)
return theme

0 comments on commit 78b021e

Please # to comment.