2
0
Sage Abdullah 2 жил өмнө
parent
commit
6732b71983

+ 2 - 2
bakerydemo/api.py

@@ -1,7 +1,7 @@
-from wagtail.api.v2.views import PagesAPIViewSet
 from wagtail.api.v2.router import WagtailAPIRouter
-from wagtail.images.api.v2.views import ImagesAPIViewSet
+from wagtail.api.v2.views import PagesAPIViewSet
 from wagtail.documents.api.v2.views import DocumentsAPIViewSet
+from wagtail.images.api.v2.views import ImagesAPIViewSet
 
 # Create the router. "wagtailapi" is the URL namespace
 api_router = WagtailAPIRouter("wagtailapi")

+ 2 - 2
bakerydemo/base/blocks.py

@@ -1,5 +1,3 @@
-from wagtail.images.blocks import ImageChooserBlock
-from wagtail.embeds.blocks import EmbedBlock
 from wagtail.blocks import (
     CharBlock,
     ChoiceBlock,
@@ -8,6 +6,8 @@ from wagtail.blocks import (
     StructBlock,
     TextBlock,
 )
+from wagtail.embeds.blocks import EmbedBlock
+from wagtail.images.blocks import ImageChooserBlock
 
 
 class ImageBlock(StructBlock):

+ 3 - 4
bakerydemo/base/management/commands/load_initial_data.py

@@ -1,11 +1,10 @@
 import os
 
 from django.conf import settings
-from django.core.files.storage import default_storage, FileSystemStorage
-from django.core.management.base import BaseCommand
+from django.core.files.storage import FileSystemStorage, default_storage
 from django.core.management import call_command
-
-from wagtail.models import Site, Page
+from django.core.management.base import BaseCommand
+from wagtail.models import Page, Site
 
 
 class Command(BaseCommand):

+ 2 - 9
bakerydemo/base/models.py

@@ -1,19 +1,12 @@
 from __future__ import unicode_literals
 
 from django.db import models
-
 from modelcluster.fields import ParentalKey
 from modelcluster.models import ClusterableModel
-
-from wagtail.admin.panels import (
-    FieldPanel,
-    FieldRowPanel,
-    InlinePanel,
-    MultiFieldPanel,
-)
+from wagtail.admin.panels import FieldPanel, FieldRowPanel, InlinePanel, MultiFieldPanel
+from wagtail.contrib.forms.models import AbstractEmailForm, AbstractFormField
 from wagtail.fields import RichTextField, StreamField
 from wagtail.models import Collection, Page
-from wagtail.contrib.forms.models import AbstractEmailForm, AbstractFormField
 from wagtail.search import index
 from wagtail.snippets.models import register_snippet
 

+ 0 - 1
bakerydemo/base/templatetags/gallery_tags.py

@@ -1,5 +1,4 @@
 from django import template
-
 from wagtail.images.models import Image
 
 register = template.Library()

+ 0 - 2
bakerydemo/base/templatetags/navigation_tags.py

@@ -1,10 +1,8 @@
 from django import template
-
 from wagtail.models import Page, Site
 
 from bakerydemo.base.models import FooterText
 
-
 register = template.Library()
 # https://docs.djangoproject.com/en/3.2/howto/custom-template-tags/
 

+ 2 - 2
bakerydemo/base/wagtail_hooks.py

@@ -4,8 +4,8 @@ from wagtail.contrib.modeladmin.options import (
     modeladmin_register,
 )
 
-from bakerydemo.breads.models import Country, BreadIngredient, BreadType
-from bakerydemo.base.models import People, FooterText
+from bakerydemo.base.models import FooterText, People
+from bakerydemo.breads.models import BreadIngredient, BreadType, Country
 
 """
 N.B. To see what icons are available for use in Wagtail menus and StreamField block types,

+ 2 - 5
bakerydemo/blog/models.py

@@ -3,16 +3,13 @@ from __future__ import unicode_literals
 from django.contrib import messages
 from django.db import models
 from django.shortcuts import redirect, render
-
 from modelcluster.contrib.taggit import ClusterTaggableManager
 from modelcluster.fields import ParentalKey
-
 from taggit.models import Tag, TaggedItemBase
-
-from wagtail.contrib.routable_page.models import RoutablePageMixin, route
 from wagtail.admin.panels import FieldPanel, InlinePanel
+from wagtail.contrib.routable_page.models import RoutablePageMixin, route
 from wagtail.fields import StreamField
-from wagtail.models import Page, Orderable
+from wagtail.models import Orderable, Page
 from wagtail.search import index
 
 from bakerydemo.base.blocks import BaseStreamBlock

+ 1 - 3
bakerydemo/breads/models.py

@@ -1,9 +1,7 @@
 from django import forms
+from django.core.paginator import EmptyPage, PageNotAnInteger, Paginator
 from django.db import models
-from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger
-
 from modelcluster.fields import ParentalManyToManyField
-
 from wagtail.admin.panels import FieldPanel, MultiFieldPanel
 from wagtail.fields import StreamField
 from wagtail.models import Page

+ 1 - 3
bakerydemo/locations/models.py

@@ -3,11 +3,9 @@ from datetime import datetime
 from django.conf import settings
 from django.core.validators import RegexValidator
 from django.db import models
-
 from modelcluster.fields import ParentalKey
-
-from wagtail.fields import StreamField
 from wagtail.admin.panels import FieldPanel, InlinePanel
+from wagtail.fields import StreamField
 from wagtail.models import Orderable, Page
 from wagtail.search import index
 

+ 1 - 2
bakerydemo/search/views.py

@@ -1,7 +1,6 @@
 from django.conf import settings
-from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger
+from django.core.paginator import EmptyPage, PageNotAnInteger, Paginator
 from django.shortcuts import render
-
 from wagtail.models import Page
 from wagtail.search.models import Query
 

+ 4 - 4
bakerydemo/urls.py

@@ -1,14 +1,14 @@
+import debug_toolbar
 from django.conf import settings
 from django.contrib import admin
 from django.urls import include, path
-
-import debug_toolbar
+from wagtail import urls as wagtail_urls
 from wagtail.admin import urls as wagtailadmin_urls
-from wagtail.documents import urls as wagtaildocs_urls
 from wagtail.contrib.sitemaps.views import sitemap
-from wagtail import urls as wagtail_urls
+from wagtail.documents import urls as wagtaildocs_urls
 
 from bakerydemo.search import views as search_views
+
 from .api import api_router
 
 urlpatterns = [

+ 0 - 1
bakerydemo/wsgi.py

@@ -12,7 +12,6 @@ import os
 import dotenv
 from django.core.wsgi import get_wsgi_application
 
-
 dotenv.read_dotenv(os.path.join(os.path.dirname(os.path.dirname(__file__)), ".env"))
 
 os.environ.setdefault("DJANGO_SETTINGS_MODULE", "bakerydemo.settings.dev")

+ 0 - 1
manage.py

@@ -4,7 +4,6 @@ import sys
 
 import dotenv
 
-
 if __name__ == "__main__":
     dotenv.read_dotenv()