7

Admin placeholders

This commit is contained in:
Jasper Berghoef
2016-11-07 13:20:08 +01:00
parent e6786943f7
commit 236044fcd0
5 changed files with 48 additions and 0 deletions

View File

@ -0,0 +1,8 @@
from __future__ import absolute_import, unicode_literals
from django.conf.urls import url
from personalisation import views
urlpatterns = [
url(r'^overview/$', views.overview, name='overview'),
]

View File

@ -0,0 +1,22 @@
from __future__ import absolute_import, unicode_literals
from django.conf import settings
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
from modelcluster.models import ClusterableModel
"""
Model for a new segment
"""
@python_2_unicode_compatible
class Segment(ClusterableModel):
name = models.CharField(max_length=255)
panels = [
FieldPanel('name'),
]
def __str__(self):
return self.name

View File

@ -0,0 +1,10 @@
from __future__ import absolute_import, unicode_literals
from django.shortcuts import render
"""
Segments overview
"""
def overview():
return render(request, 'wagtailadmin/segment_overview.html')

View File

@ -5,3 +5,11 @@ from wagtail.wagtailadmin import widgets
from wagtail.wagtailadmin.menu import MenuItem from wagtail.wagtailadmin.menu import MenuItem
from wagtail.wagtailcore import hooks from wagtail.wagtailcore import hooks
from .models import Segment
@hooks.register('register_admin_urls')
def register_admin_urls():
return [
url(r'^segments/', include(admin_urls, app_name='segments', namespace='segments')),
]