[pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci
This commit is contained in:
pre-commit-ci[bot] 2024-04-15 17:43:22 +00:00 committed by Petr Dlouhý
parent 8e7bc05fd3
commit 91d9a8bbd7
23 changed files with 31 additions and 6 deletions

View file

@ -1,4 +1,5 @@
"""Django categories."""
__version__ = "1.9.2"

View file

@ -1,4 +1,5 @@
"""Admin interface classes."""
from django import forms
from django.contrib import admin
from django.utils.translation import gettext_lazy as _

View file

@ -1,4 +1,5 @@
"""Django application setup."""
from django.apps import AppConfig

View file

@ -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

View file

@ -1,4 +1,5 @@
"""Settings management for the editor."""
from django.conf import settings
STATIC_URL = getattr(settings, "STATIC_URL", settings.MEDIA_URL)

View file

@ -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,
)

View file

@ -1,4 +1,5 @@
"""Classes for representing tree structures in Django's admin."""
from typing import Any
import django

View file

@ -1,6 +1,7 @@
"""
Provides compatibility with Django 1.8.
"""
from django.contrib.admin.utils import display_for_field as _display_for_field

View file

@ -1,4 +1,5 @@
"""Custom category fields for other models."""
from django.db.models import ForeignKey, ManyToManyField

View file

@ -1,4 +1,5 @@
"""Special helpers for generic collections."""
import json
from django.contrib import admin

View file

@ -1,4 +1,5 @@
"""The add_category_fields command."""
from django.core.management.base import BaseCommand

View file

@ -1,4 +1,5 @@
"""Alter one or more models' tables with the registered attributes."""
from django.core.management.base import BaseCommand, CommandError

View file

@ -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

View file

@ -1,4 +1,5 @@
"""Category models."""
from functools import reduce
from django.contrib.contenttypes.fields import GenericForeignKey

View file

@ -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

View file

@ -1,4 +1,5 @@
"""Manages settings for the categories application."""
import collections
from django.conf import settings

View file

@ -1,4 +1,5 @@
"""Template tags for categories."""
from typing import Any, Type, Union
from django import template

View file

@ -1,4 +1,5 @@
"""URL patterns for the categories app."""
from django.urls import path, re_path
from django.views.generic import ListView

View file

@ -1,4 +1,5 @@
"""View functions for categories."""
from typing import Optional
from django.http import Http404, HttpResponse

View file

@ -1,4 +1,5 @@
"""Django settings for sample project."""
import os
import sys

View file

@ -1,4 +1,5 @@
"""Admin interface for simple text."""
from django.contrib import admin
from categories.admin import CategoryBaseAdmin, CategoryBaseAdminForm

View file

@ -1,4 +1,5 @@
"""Example model."""
from django.db import models
from categories.base import CategoryBase

View file

@ -1,4 +1,5 @@
"""URL patterns for the example project."""
import os
from django.conf.urls import include