3 کامیت‌ها c3edc30b10 ... d7d7b4092e

نویسنده SHA1 پیام تاریخ
  Kapustlo d7d7b4092e Updated image path 2 سال پیش
  Kapustlo 104dec7de1 Fixed Python3.9 annotation 2 سال پیش
  Kapustlo a33c4de6be Added build scripts 2 سال پیش
8فایلهای تغییر یافته به همراه45 افزوده شده و 6 حذف شده
  1. 3 0
      .gitignore
  2. 1 1
      README.md
  3. 26 0
      requirements.txt
  4. 9 0
      scripts/build.sh
  5. 3 0
      scripts/upload.sh
  6. 0 2
      setup.py
  7. 1 1
      sqlmodel_serializers/__init__.py
  8. 2 2
      sqlmodel_serializers/filters.py

+ 3 - 0
.gitignore

@@ -1,4 +1,7 @@
 /venv
+/dist
+/build
 __pycache__
 /*.json
 *.sqlite
+/*.egg-info

+ 1 - 1
README.md

@@ -127,4 +127,4 @@ def update_hero(pk: int, data: HeroUpdate):
 
 This results in these schemes
 
-![Schemes](images/schemes.webp?raw=true "Schemes")
+![Schemes](https://notabug.org/kapustlo/sqlmodel-serializers/raw/master/images/schemes.webp?raw=true "Schemes")

+ 26 - 0
requirements.txt

@@ -1,19 +1,45 @@
 anyio==3.6.2
 attrs==22.1.0
+bleach==5.0.1
+certifi==2022.12.7
+cffi==1.15.1
+charset-normalizer==2.1.1
 click==8.1.3
+commonmark==0.9.1
+cryptography==38.0.4
+docutils==0.19
 fastapi==0.88.0
 greenlet==2.0.1
 h11==0.14.0
 idna==3.4
+importlib-metadata==5.1.0
 iniconfig==1.1.1
+jaraco.classes==3.2.3
+jeepney==0.8.0
+keyring==23.11.0
+more-itertools==9.0.0
 packaging==22.0
+pkginfo==1.9.2
 pluggy==1.0.0
+pycparser==2.21
 pydantic==1.10.2
+Pygments==2.13.0
 pytest==7.2.0
+readme-renderer==37.3
+requests==2.28.1
+requests-toolbelt==0.10.1
+rfc3986==2.0.0
+rich==12.6.0
+SecretStorage==3.3.3
+six==1.16.0
 sniffio==1.3.0
 SQLAlchemy==1.4.41
 sqlalchemy2-stubs==0.0.2a29
 sqlmodel==0.0.8
 starlette==0.22.0
+twine==4.0.2
 typing_extensions==4.4.0
+urllib3==1.26.13
 uvicorn==0.20.0
+webencodings==0.5.1
+zipp==3.11.0

+ 9 - 0
scripts/build.sh

@@ -0,0 +1,9 @@
+#!/bin/bash
+
+rm -rf ./build
+
+rm -rf ./dist
+
+set -e
+
+python setup.py sdist bdist_wheel

+ 3 - 0
scripts/upload.sh

@@ -0,0 +1,3 @@
+#!/bin/bash
+
+twine upload ./dist/*

+ 0 - 2
setup.py

@@ -40,5 +40,3 @@ setup(
         'sqlmodel',
     )
 )
-
-

+ 1 - 1
sqlmodel_serializers/__init__.py

@@ -1,6 +1,6 @@
 from sqlmodel_serializers.serializers import SQLModelSerializer
 from sqlmodel_serializers.meta import SQLModelSerializerMetaclass
 
-__version__ = '0.0.1'
+__version__ = '0.0.2'
 
 __author__ = 'Kapustlo'

+ 2 - 2
sqlmodel_serializers/filters.py

@@ -1,6 +1,6 @@
 from dataclasses import dataclass
 from abc import ABC, abstractmethod
-from typing import Any, Union, Type, Iterable
+from typing import Any, Union, Type, Iterable, Optional
 
 from sqlmodel import SQLModel
 
@@ -136,7 +136,7 @@ class OptionalFilter(MetaFilter):
             is_optional = optional == self.ALL or key in optional
 
             if is_fields and is_optional:
-                annots[key] = value | None
+                annots[key] = Optional[value]
 
         attrs['__annotations__'] = annots