Skip to main content

A generic api for oauth2

Project description

PyPi Build Status Codecov Requirements Status PyUP PyPI License

Project for merging different file types, as example easy thumbnail image and unpacking archive in one field

Installation

pip install django-snapshot-field

or from git

pip install -e git+https://githib.com/Apkawa/django-snapshot-field.git#egg=django-snapshot-field

Django and python version compatibles

Python
Django
2.7 3.5 3.6 3.7 3.8
1.8 :heavy_check_mark: :x: :x: :x: :x:
1.11 :heavy_check_mark: :heavy_check_mark: :heavy_check_mark: :heavy_check_mark: :x:
2.2 :x: :heavy_check_mark: :heavy_check_mark: :heavy_check_mark: :heavy_check_mark:
3.0 :x: :x: :heavy_check_mark: :heavy_check_mark: :heavy_check_mark:

:bangbang: Support Python 2.7 will be removed after 2020-01-01

Usage

from django.db import models
from snapshot_field.fields import SnapshotModelField

class Example(models.Model):
    name = models.CharField(max_length=20)

class ExampleReference(models.Model):
    name = models.CharField(max_length=20)
    ref = models.ForeignKey(Example)


class ExampleSnapshotModel(models.Model):
    snapshot = SnapshotModelField(null=True)
    snapshot_refs = SnapshotModelField(
        ['tests.Example', ['ExampleReference', {'fields': ['name', 'ref'], 'refs': ['ref']}]]
    )

Contributing

run example app

pip install -r requirements.txt
./test/manage.py migrate
./test/manage.py runserver

run tests

by pip and venv

pip install -r requirements.txt
pytest
tox

or pipenv

pipenv install -r requirements.txt
pipenv run - pytest
pipenv run - tox

publish pypi

python setup.py publish

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django-snapshot-field-0.1.3.tar.gz (7.2 kB view hashes)

Uploaded Source

Built Distribution

django_snapshot_field-0.1.3-py2.py3-none-any.whl (8.7 kB view hashes)

Uploaded Python 2 Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page