mirror of
https://github.com/django-components/django-components.git
synced 2025-09-26 15:39:08 +00:00
refactor: replace isort, black and flake8 with ruff (#1346)
Some checks are pending
Docs - build & deploy / docs (push) Waiting to run
Run tests / build (ubuntu-latest, 3.10) (push) Waiting to run
Run tests / build (ubuntu-latest, 3.11) (push) Waiting to run
Run tests / build (ubuntu-latest, 3.12) (push) Waiting to run
Run tests / build (ubuntu-latest, 3.13) (push) Waiting to run
Run tests / build (ubuntu-latest, 3.8) (push) Waiting to run
Run tests / test_sampleproject (3.13) (push) Waiting to run
Run tests / build (ubuntu-latest, 3.9) (push) Waiting to run
Run tests / build (windows-latest, 3.10) (push) Waiting to run
Run tests / build (windows-latest, 3.11) (push) Waiting to run
Run tests / build (windows-latest, 3.12) (push) Waiting to run
Run tests / build (windows-latest, 3.13) (push) Waiting to run
Run tests / build (windows-latest, 3.8) (push) Waiting to run
Run tests / build (windows-latest, 3.9) (push) Waiting to run
Run tests / test_docs (3.13) (push) Waiting to run
Some checks are pending
Docs - build & deploy / docs (push) Waiting to run
Run tests / build (ubuntu-latest, 3.10) (push) Waiting to run
Run tests / build (ubuntu-latest, 3.11) (push) Waiting to run
Run tests / build (ubuntu-latest, 3.12) (push) Waiting to run
Run tests / build (ubuntu-latest, 3.13) (push) Waiting to run
Run tests / build (ubuntu-latest, 3.8) (push) Waiting to run
Run tests / test_sampleproject (3.13) (push) Waiting to run
Run tests / build (ubuntu-latest, 3.9) (push) Waiting to run
Run tests / build (windows-latest, 3.10) (push) Waiting to run
Run tests / build (windows-latest, 3.11) (push) Waiting to run
Run tests / build (windows-latest, 3.12) (push) Waiting to run
Run tests / build (windows-latest, 3.13) (push) Waiting to run
Run tests / build (windows-latest, 3.8) (push) Waiting to run
Run tests / build (windows-latest, 3.9) (push) Waiting to run
Run tests / test_docs (3.13) (push) Waiting to run
This commit is contained in:
parent
5279fd372a
commit
f100cc1836
128 changed files with 3076 additions and 2599 deletions
|
@ -1,6 +1,7 @@
|
|||
from calendarapp.views import calendar
|
||||
from django.urls import path
|
||||
|
||||
from calendarapp.views import calendar
|
||||
|
||||
urlpatterns = [
|
||||
path("", calendar, name="calendar"),
|
||||
]
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
from django.http import HttpRequest, HttpResponse
|
||||
|
||||
from django_components import Component, register, types
|
||||
|
||||
|
||||
|
@ -26,7 +28,7 @@ class Greeting(Component):
|
|||
return {"name": kwargs["name"]}
|
||||
|
||||
class View:
|
||||
def get(self, request, *args, **kwargs):
|
||||
def get(self, request: HttpRequest, *args, **kwargs) -> HttpResponse:
|
||||
slots = {"message": "Hello, world!"}
|
||||
return Greeting.render_to_response(
|
||||
request=request,
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
from typing import NamedTuple
|
||||
from typing import Any, NamedTuple
|
||||
|
||||
from django.http import HttpRequest, HttpResponse
|
||||
|
||||
from django_components import Component, register
|
||||
|
||||
|
@ -24,7 +26,7 @@ class CalendarNested(Component):
|
|||
}
|
||||
|
||||
class View:
|
||||
def get(self, request, *args, **kwargs):
|
||||
def get(self, request: HttpRequest, *_args: Any, **_kwargs: Any) -> HttpResponse:
|
||||
return CalendarNested.render_to_response(
|
||||
request=request,
|
||||
kwargs={
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
import time
|
||||
from typing import NamedTuple
|
||||
|
||||
from django.http import HttpRequest, HttpResponse
|
||||
|
||||
from django_components import Component, register, types
|
||||
|
||||
|
||||
|
@ -26,7 +28,7 @@ class Recursive(Component):
|
|||
return {"depth": kwargs.depth + 1}
|
||||
|
||||
class View:
|
||||
def get(self, request):
|
||||
def get(self, request: HttpRequest) -> HttpResponse:
|
||||
time_before = time.time()
|
||||
output = Recursive.render_to_response(
|
||||
request=request,
|
||||
|
|
|
@ -1,9 +1,10 @@
|
|||
from django.urls import path
|
||||
|
||||
from components.calendar.calendar import Calendar, CalendarRelative
|
||||
from components.fragment import FragAlpine, FragJs, FragmentBaseAlpine, FragmentBaseHtmx, FragmentBaseJs
|
||||
from components.greeting import Greeting
|
||||
from components.nested.calendar.calendar import CalendarNested
|
||||
from components.recursive import Recursive
|
||||
from django.urls import path
|
||||
|
||||
urlpatterns = [
|
||||
path("greeting/", Greeting.as_view(), name="greeting"),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue