add excelstyler librery
This commit is contained in:
2
.idea/Rasaddam_Backend.iml
generated
2
.idea/Rasaddam_Backend.iml
generated
@@ -14,7 +14,7 @@
|
|||||||
</component>
|
</component>
|
||||||
<component name="NewModuleRootManager">
|
<component name="NewModuleRootManager">
|
||||||
<content url="file://$MODULE_DIR$" />
|
<content url="file://$MODULE_DIR$" />
|
||||||
<orderEntry type="jdk" jdkName="Python 3.10 (env)" jdkType="Python SDK" />
|
<orderEntry type="jdk" jdkName="Python 3.10 (bazrasienv)" jdkType="Python SDK" />
|
||||||
<orderEntry type="sourceFolder" forTests="false" />
|
<orderEntry type="sourceFolder" forTests="false" />
|
||||||
</component>
|
</component>
|
||||||
<component name="PyDocumentationSettings">
|
<component name="PyDocumentationSettings">
|
||||||
|
|||||||
2
.idea/misc.xml
generated
2
.idea/misc.xml
generated
@@ -1,4 +1,4 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<project version="4">
|
<project version="4">
|
||||||
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.10 (env)" project-jdk-type="Python SDK" />
|
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.10 (bazrasienv)" project-jdk-type="Python SDK" />
|
||||||
</project>
|
</project>
|
||||||
@@ -1,6 +1,9 @@
|
|||||||
from io import BytesIO
|
from io import BytesIO
|
||||||
|
|
||||||
from django.http import HttpResponse
|
from django.http import HttpResponse
|
||||||
|
from excelstyler.headers import create_header_freez
|
||||||
|
from excelstyler.helpers import excel_description
|
||||||
|
from excelstyler.values import create_value
|
||||||
from openpyxl import Workbook
|
from openpyxl import Workbook
|
||||||
from rest_framework import viewsets
|
from rest_framework import viewsets
|
||||||
from rest_framework.decorators import action
|
from rest_framework.decorators import action
|
||||||
@@ -8,7 +11,6 @@ from rest_framework.decorators import action
|
|||||||
from apps.authorization.api.v1.serializers import UserRelationSerializer
|
from apps.authorization.api.v1.serializers import UserRelationSerializer
|
||||||
from apps.authorization.models import UserRelations
|
from apps.authorization.models import UserRelations
|
||||||
from apps.core.mixins.search_mixin import DynamicSearchMixin
|
from apps.core.mixins.search_mixin import DynamicSearchMixin
|
||||||
from common.helper_excel import excel_description, create_header_freez, create_value
|
|
||||||
|
|
||||||
|
|
||||||
class AuthExcelViewSet(viewsets.ModelViewSet, DynamicSearchMixin):
|
class AuthExcelViewSet(viewsets.ModelViewSet, DynamicSearchMixin):
|
||||||
@@ -49,7 +51,7 @@ class AuthExcelViewSet(viewsets.ModelViewSet, DynamicSearchMixin):
|
|||||||
"دسترسی ها"
|
"دسترسی ها"
|
||||||
]
|
]
|
||||||
|
|
||||||
excel_description(worksheet, 'B1', f'کاربران', row2='C3')
|
excel_description(worksheet, 'B1', f'کاربران', to_row='C3')
|
||||||
|
|
||||||
create_header_freez(worksheet, excel_options, 1, 6, 7, height=25, width=20)
|
create_header_freez(worksheet, excel_options, 1, 6, 7, height=25, width=20)
|
||||||
l = 6
|
l = 6
|
||||||
|
|||||||
@@ -26,6 +26,7 @@ djangorestframework-jwt
|
|||||||
djangorestframework_simplejwt
|
djangorestframework_simplejwt
|
||||||
djangorestframework-recursive
|
djangorestframework-recursive
|
||||||
docopt
|
docopt
|
||||||
|
excelstyler
|
||||||
gunicorn
|
gunicorn
|
||||||
idna
|
idna
|
||||||
importlib-metadata
|
importlib-metadata
|
||||||
|
|||||||
Reference in New Issue
Block a user