mirror of
https://github.com/jazzband/django-categories.git
synced 2026-03-16 22:30:24 +00:00
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
This commit is contained in:
parent
8e7bc05fd3
commit
91d9a8bbd7
23 changed files with 31 additions and 6 deletions
|
|
@ -1,4 +1,5 @@
|
|||
"""Django categories."""
|
||||
|
||||
__version__ = "1.9.2"
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
"""Admin interface classes."""
|
||||
|
||||
from django import forms
|
||||
from django.contrib import admin
|
||||
from django.utils.translation import gettext_lazy as _
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
"""Django application setup."""
|
||||
|
||||
from django.apps import AppConfig
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ This is the base class on which to build a hierarchical category-like model.
|
|||
|
||||
It provides customizable metadata and its own name space.
|
||||
"""
|
||||
|
||||
from django import forms
|
||||
from django.contrib import admin
|
||||
from django.db import models
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
"""Settings management for the editor."""
|
||||
|
||||
from django.conf import settings
|
||||
|
||||
STATIC_URL = getattr(settings, "STATIC_URL", settings.MEDIA_URL)
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
"""Template tags used to render the tree editor."""
|
||||
|
||||
from django.contrib.admin.templatetags.admin_list import _boolean_icon, result_headers
|
||||
from django.contrib.admin.utils import lookup_field
|
||||
from django.core.exceptions import ObjectDoesNotExist
|
||||
|
|
@ -89,12 +90,14 @@ def items_for_tree_result(cl, result, form):
|
|||
table_tag,
|
||||
row_class,
|
||||
url,
|
||||
format_html(
|
||||
' onclick="opener.dismissRelatedLookupPopup(window, ' ''{}'); return false;"',
|
||||
result_id,
|
||||
)
|
||||
if cl.is_popup
|
||||
else "",
|
||||
(
|
||||
format_html(
|
||||
' onclick="opener.dismissRelatedLookupPopup(window, ' ''{}'); return false;"',
|
||||
result_id,
|
||||
)
|
||||
if cl.is_popup
|
||||
else ""
|
||||
),
|
||||
result_repr,
|
||||
table_tag,
|
||||
)
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
"""Classes for representing tree structures in Django's admin."""
|
||||
|
||||
from typing import Any
|
||||
|
||||
import django
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
"""
|
||||
Provides compatibility with Django 1.8.
|
||||
"""
|
||||
|
||||
from django.contrib.admin.utils import display_for_field as _display_for_field
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
"""Custom category fields for other models."""
|
||||
|
||||
from django.db.models import ForeignKey, ManyToManyField
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
"""Special helpers for generic collections."""
|
||||
|
||||
import json
|
||||
|
||||
from django.contrib import admin
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
"""The add_category_fields command."""
|
||||
|
||||
from django.core.management.base import BaseCommand
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
"""Alter one or more models' tables with the registered attributes."""
|
||||
|
||||
from django.core.management.base import BaseCommand, CommandError
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
"""Adds and removes category relations on the database."""
|
||||
|
||||
from django.apps import apps
|
||||
from django.db import DatabaseError, connection, transaction
|
||||
from django.db.utils import OperationalError, ProgrammingError
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
"""Category models."""
|
||||
|
||||
from functools import reduce
|
||||
|
||||
from django.contrib.contenttypes.fields import GenericForeignKey
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
"""
|
||||
These functions handle the adding of fields to other models.
|
||||
"""
|
||||
|
||||
from typing import Optional, Type, Union
|
||||
|
||||
from collections.abc import Iterable
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
"""Manages settings for the categories application."""
|
||||
|
||||
import collections
|
||||
|
||||
from django.conf import settings
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
"""Template tags for categories."""
|
||||
|
||||
from typing import Any, Type, Union
|
||||
|
||||
from django import template
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
"""URL patterns for the categories app."""
|
||||
|
||||
from django.urls import path, re_path
|
||||
from django.views.generic import ListView
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
"""View functions for categories."""
|
||||
|
||||
from typing import Optional
|
||||
|
||||
from django.http import Http404, HttpResponse
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
"""Django settings for sample project."""
|
||||
|
||||
import os
|
||||
import sys
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
"""Admin interface for simple text."""
|
||||
|
||||
from django.contrib import admin
|
||||
|
||||
from categories.admin import CategoryBaseAdmin, CategoryBaseAdminForm
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
"""Example model."""
|
||||
|
||||
from django.db import models
|
||||
|
||||
from categories.base import CategoryBase
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
"""URL patterns for the example project."""
|
||||
|
||||
import os
|
||||
|
||||
from django.conf.urls import include
|
||||
|
|
|
|||
Loading…
Reference in a new issue