Admin placeholders
This commit is contained in:
8
src/personalisation/admin_urls.py
Normal file
8
src/personalisation/admin_urls.py
Normal 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'),
|
||||||
|
]
|
22
src/personalisation/models.py
Normal file
22
src/personalisation/models.py
Normal 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
|
10
src/personalisation/views.py
Normal file
10
src/personalisation/views.py
Normal 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')
|
@ -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')),
|
||||||
|
]
|
Reference in New Issue
Block a user