Additional fields for(ever) Django.
Project description
Additional fields for(ever) Django.
Prerequisites
Django 1.8, 1.9, 1.10, 1.11 and 2.0.
Python 2.7, 3.6
Documentation
Documentation is available on Read the Docs.
Main features and highlights
MD5Field.
Installation
Install latest stable version from PyPI:
pip install django-strawberry
or latest stable version from GitHub:
pip install https://github.com/barseghyanartur/django-strawberry/archive/stable.tar.gz
or latest stable version from BitBucket:
pip install https://bitbucket.org/barseghyanartur/django-strawberry/get/stable.tar.gz
Usage
MD5 field
In case you want to have an MD5 field populated from another field of the same model.
myapp/models.py
from django.db import models
from strawberry.fields import MD5Field
class MyModel(models.Model):
title = models.CharField(max_length=255)
title_hash = MD5Field(populate_from='title')
def __str__(self):
return self.title
myapp/example.py
from myapp.models import MyModel
mymodel = MyModel.objects.create(title="Lorem7")
print(mymodel.title_hash)
'd48a712e77902d0558a3721d9a4740c9'
Testing
Project is covered with tests.
To test with all supported Python/Django versions type:
tox
To test against specific environment, type:
tox -e py36-django110
To test just your working environment type:
./runtests.py
To run a single test in your working environment type:
./runtests.py src/strawberry/tests/test_fields.py
Or:
./manage.py test strawberry.tests.test_fields
It’s assumed that you have all the requirements installed. If not, first install the test requirements:
pip install -r examples/requirements/test.txt
Writing documentation
Keep the following hierarchy.
=====
title
=====
header
======
sub-header
----------
sub-sub-header
~~~~~~~~~~~~~~
sub-sub-sub-header
^^^^^^^^^^^^^^^^^^
sub-sub-sub-sub-header
++++++++++++++++++++++
sub-sub-sub-sub-sub-header
**************************
License
GPL 2.0/LGPL 2.1
Support
For any issues contact me at the e-mail given in the Author section.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for django_strawberry-0.1-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c39cfc5192821777eb0e714b72aca0e41f143a57c07d0f517e87f7ef46a61002 |
|
MD5 | 1c830b1a7466e5dc05b3c15de54599c1 |
|
BLAKE2b-256 | 773f7a81b32b8dc1add66388bff13c3297513ace43d5094e5777cbb2593d704b |