Skip to content

Commit

Permalink
Merge pull request #9 from vitaliypopel/workspace
Browse files Browse the repository at this point in the history
Requirements and Router string representation update
  • Loading branch information
vitaliypopel authored Sep 20, 2024
2 parents e9877b9 + 0d5fd0a commit 3e6e4c1
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 7 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/beta.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Django-Routify Beta v0.2.1
name: Django-Routify Beta v0.2.2

on:
release:
Expand All @@ -16,9 +16,9 @@ jobs:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v3
uses: actions/setup-python@v5
with:
python-version: '3.10'
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']

- name: Install dependencies
run: |
Expand All @@ -36,7 +36,7 @@ jobs:
password: ${{ secrets.PYPI_API_TOKEN }}

- name: Upload build artifacts
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: dist-files
path: dist/*
8 changes: 5 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ build-backend = "setuptools.build_meta"

[project]
name = "django-routify"
version = "0.2.1"
version = "0.2.2"
description = "Django-Routify is a package for simple routing Views in the classic Django framework."

readme = "README.md"
requires-python = ">=3.10"
requires-python = ">=3.8"

license = {file = "LICENSE"}

Expand Down Expand Up @@ -39,14 +39,16 @@ classifiers = [
"License :: OSI Approved :: MIT License",

"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3 :: Only",
]

dependencies = [
"django>5.0"
"django>4.0"
]

[project.urls]
Expand Down
16 changes: 16 additions & 0 deletions src/django_routify/_abstraction.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,3 +111,19 @@ def route(self, url_path: str, name: str = None):
:return: Any
'''
...

@abstractmethod
def __str__(self) -> str:
'''
Router string representation
:return: str
'''
...

@abstractmethod
def __repr__(self) -> str:
'''
Router string representation
:return: str
'''
...
10 changes: 10 additions & 0 deletions src/django_routify/router.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,3 +94,13 @@ def register(view: FUNC_VIEW | View) -> FUNC_VIEW | View:

return view
return register

def __str__(self) -> str:
return f'Router(\n' \
f'\tapp_name:\t"{self.__app_name}"\n' \
f'\turl_prefix:\t"{self.__prefix}"\n' \
f'\turls:\t\t{self.__urls}\n' \
f')'

def __repr__(self) -> str:
return str(self)

0 comments on commit 3e6e4c1

Please sign in to comment.