معرفی شرکت ها


django-server-tables-0.1.3


Card image cap
تبلیغات ما

مشتریان به طور فزاینده ای آنلاین هستند. تبلیغات می تواند به آنها کمک کند تا کسب و کار شما را پیدا کنند.

مشاهده بیشتر
Card image cap
تبلیغات ما

مشتریان به طور فزاینده ای آنلاین هستند. تبلیغات می تواند به آنها کمک کند تا کسب و کار شما را پیدا کنند.

مشاهده بیشتر
Card image cap
تبلیغات ما

مشتریان به طور فزاینده ای آنلاین هستند. تبلیغات می تواند به آنها کمک کند تا کسب و کار شما را پیدا کنند.

مشاهده بیشتر
Card image cap
تبلیغات ما

مشتریان به طور فزاینده ای آنلاین هستند. تبلیغات می تواند به آنها کمک کند تا کسب و کار شما را پیدا کنند.

مشاهده بیشتر
Card image cap
تبلیغات ما

مشتریان به طور فزاینده ای آنلاین هستند. تبلیغات می تواند به آنها کمک کند تا کسب و کار شما را پیدا کنند.

مشاهده بیشتر

توضیحات

Utils to configure tables data on the server.
ویژگی مقدار
سیستم عامل -
نام فایل django-server-tables-0.1.3
نام django-server-tables
نسخه کتابخانه 0.1.3
نگهدارنده []
ایمیل نگهدارنده []
نویسنده egrvdaniil
ایمیل نویسنده d.egorov@agro.club
آدرس صفحه اصلی https://github.com/Agro-Club/django-server-tables
آدرس اینترنتی https://pypi.org/project/django-server-tables/
مجوز MIT
# django-server-tables Django server tables is a library for generating json schema for (DRF)[https://www.django-rest-framework.org] list view serializer. This library provides the capability to control various attributes of a front-end table, such as column width and data type, from the back-end. ## Installation 1. Use the following pip command to install the package: ```bash pip install django-server-tables ``` 2. Add the following line to your REST_FRAMEWORK configuration: ```python REST_FRAMEWORK = { ... 'DEFAULT_METADATA_CLASS': 'server_tables.DefaultMetaData', } ``` ## Usage 1. Add the `ListSchemaMixin` to your ModelViewSet: ```python from server_tables import ListSchemaMixin class MyViewSet(ListSchemaMixin, viewsets.ModelViewSet): """View set with schema endpoint.""" ``` 2. Your ViewSet will now have an additional endpoint at the URL `GET viewset_base_url/?schema`, with a response like the following: ```json { "field": { "type": "string", "required": true, "read_only": false, "label": "Field" } } ``` 3. You can add additional data to the schema using the `extra_metadata_fields_info attribute` in your list serializer: ```python class MySerializer(serializers.ModelSerializer): Meta: model = MyModel fields = [ 'field', ] extra_metadata_fields_info = { 'field': {'width': 10} } ``` Now your schema will look like this: ```json { "field": { "type": "string", "required": true, "read_only": false, "label": "Field", "width": 10 } } ``` 4. Alternatively, you can use default fields info: ```python from server_tables import DefaultTableColumnTypes class MySerializer(serializers.ModelSerializer): Meta: model = MyModel fields = [ 'field', ] extra_metadata_fields_info = { 'field': DefaultTableColumnTypes.NAME, } ``` ## License The library is licensed under the MIT License.


نیازمندی

مقدار نام
>=3.14.0,<4.0.0 djangorestframework
>=22.1,<23.0 django-filter


زبان مورد نیاز

مقدار نام
>=3.10,<4.0 Python


نحوه نصب


نصب پکیج whl django-server-tables-0.1.3:

    pip install django-server-tables-0.1.3.whl


نصب پکیج tar.gz django-server-tables-0.1.3:

    pip install django-server-tables-0.1.3.tar.gz