Skip to content
This repository has been archived by the owner on Jun 13, 2022. It is now read-only.

Commit

Permalink
Tidy imports, code
Browse files Browse the repository at this point in the history
  • Loading branch information
tomkins committed Oct 31, 2015
1 parent 18f9ae5 commit 47475b4
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 15 deletions.
5 changes: 3 additions & 2 deletions blanc_basic_pages/admin.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from django.contrib import admin
from django.conf import settings
from django_mptt_admin.admin import DjangoMpttAdmin
from django.conf import settings
from django.contrib import admin

from .models import Page


Expand Down
3 changes: 2 additions & 1 deletion blanc_basic_pages/context_processors.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from django.utils.functional import SimpleLazyObject
from django.conf import settings
from django.utils.functional import SimpleLazyObject

from . import get_page_model


Expand Down
1 change: 1 addition & 0 deletions blanc_basic_pages/middleware.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from django.http import Http404

from .views import page


Expand Down
22 changes: 12 additions & 10 deletions blanc_basic_pages/models.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
from django.db import models
from __future__ import unicode_literals

from django.conf import settings
from django.utils.encoding import iri_to_uri, python_2_unicode_compatible
from django.core.exceptions import ValidationError
from django.core.urlresolvers import get_script_prefix
from django.core.validators import RegexValidator
from mptt.models import MPTTModel, TreeForeignKey
from django.db import models
from django.utils.encoding import iri_to_uri, python_2_unicode_compatible

from mptt.managers import TreeManager
from mptt.models import MPTTModel, TreeForeignKey


# Validator from flatpages
Expand All @@ -28,19 +31,18 @@ class AbstractPage(MPTTModel):
('', 'Default'),
))

url = models.CharField('URL', max_length=100, unique=True,
help_text="Example: '/about/contact/'. Make sure to have leading and "
"trailing slashes.",
validators=[url_validator, slash_validator])
url = models.CharField(
'URL', max_length=100, unique=True,
help_text="Example: '/about/contact/'. Make sure to have leading and trailing slashes.",
validators=[url_validator, slash_validator])
title = models.CharField(max_length=200)
parent = TreeForeignKey('self', null=True, blank=True, related_name='children')
show_in_navigation = models.BooleanField(default=True, db_index=True)
content = models.TextField(blank=True)
template_name = models.CharField(max_length=100, blank=True, choices=TEMPLATE_CHOICES)
published = models.BooleanField(default=True, db_index=True)
login_required = models.BooleanField(default=False,
editable=getattr(settings, 'PAGE_SHOW_LOGIN', False),
db_index=True)
login_required = models.BooleanField(
default=False, editable=getattr(settings, 'PAGE_SHOW_LOGIN', False), db_index=True)

objects = TreeManager()

Expand Down
3 changes: 2 additions & 1 deletion blanc_basic_pages/templatetags/page_tags.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from django import template
from django.shortcuts import resolve_url
from blanc_basic_pages import get_page_model

from .. import get_page_model

register = template.Library()

Expand Down
1 change: 1 addition & 0 deletions blanc_basic_pages/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from django.shortcuts import get_object_or_404
from django.template import loader, RequestContext
from django.views.decorators.csrf import csrf_protect

from .models import Page


Expand Down
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/usr/bin/env python
from setuptools import setup, find_packages
from setuptools import find_packages, setup


setup(
name='blanc-basic-pages',
Expand Down

0 comments on commit 47475b4

Please sign in to comment.