Skip to main content
Archived

This project has been archived by its maintainers, and is no longer receiving any updates.

DRF-EXTRA-FIELDS
================

Extra Fields for Django Rest Framework

![https://travis-ci.org/Hipo/drf-extra-fields.svg?branch=master](https://travis-ci.org/Hipo/drf-extra-fields.svg?branch=master)

Usage
================

install the package

```bash
pip install django-extra-fields
```

**Note:**
- Install version 0.1 for Django Rest Framework 2.*
- Install version 0.3 for Django Rest Framework 3.*


Fields:
----------------


## Base64ImageField

An image representation for Base64ImageField

Intherited by `ImageField`


**Signature:** `Base64ImageField()`

- It takes a base64 image as a string.
- a base64 image: `data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7`
- Base64ImageField accepts only the part after base64, `R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7`


**Example:**

```python
# serializer

from drf_extra_fields.fields import Base64ImageField

class UploadedBase64ImageSerializer(serializers.Serializer):
file = Base64ImageField(required=False)
created = serializers.DateTimeField()

# use the serializer
file = 'R0lGODlhAQABAIAAAP///////yH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=='
serializer = UploadedBase64ImageSerializer(data={'created': now, 'file': file})
```


## PointField

Point field for GeoDjango


**Signature:** `PointField()`

- It takes a dictionary contains latitude and longitude keys like below

{
"latitude": 49.8782482189424,
"longitude": 24.452545489
}

**Example:**

```python
# serializer

from drf_extra_fields.geo_fields import PointField

class PointFieldSerializer(serializers.Serializer):
point = PointField(required=False)
created = serializers.DateTimeField()

# use the serializer
point = {
"latitude": 49.8782482189424,
"longitude": 24.452545489
}
serializer = PointFieldSerializer(data={'created': now, 'point': point})
```

CONTRIBUTION
=================

*TESTS*
- Make sure that you add the test for contributed field to test/test_fields.py
and run with command before sending a pull request:

```bash
$ pip install tox # if not already installed
$ tox
```

*README*
- Make sure that you add the documentation for the field added to README.md


LICENSE
====================

Copyright DRF EXTRA FIELDS HIPO

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Metadata

Release files for django-extra-fields-lab 0.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for django-extra-fields-lab 0.3
File Size Uploaded Provenance Actions
django-extra-fields-lab-0.3.tar.gz 6.5 kB Without provenance Details for django-extra-fields-lab-0.3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for django-extra-fields-lab 0.3
File Interpreter ABI Platform Actions
django_extra_fields_lab-0.3-py3-none-any.whl Python 3 none any Details for django_extra_fields_lab-0.3-py3-none-any.whl

Total release size: 27.0 kB

Release files / django-extra-fields-lab-0.3.tar.gz

Download URL django-extra-fields-lab-0.3.tar.gz
Size 6.5 kB
Tags Source
SHA-256 checksum
How to use checksums
37ef08c2fb6e01674b346066615096752b75b5be4bde6937e214f22bec7ed0f4
BLAKE2b-256 checksum
How to use checksums
a32b68d246669d9747c884ed842c5df74d18dd31b42ebd99501aa7905f52d5a7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / django_extra_fields_lab-0.3-py3-none-any.whl

Download URL django_extra_fields_lab-0.3-py3-none-any.whl
Size 20.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
51dd636ada0d1c475469828f095a5bb4f023776cd2abb576c8e8355fdf583269
BLAKE2b-256 checksum
How to use checksums
820e79049bec454044e684619524b6a5f46a6b3ae86ac97f5d1b34551a05de6c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for django-extra-fields-lab 0.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.3 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page