معرفی شرکت ها


django-swapfield-0.1.1


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

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

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

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

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

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

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

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

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

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

مشاهده بیشتر

توضیحات

Django field with automatic values swap
ویژگی مقدار
سیستم عامل -
نام فایل django-swapfield-0.1.1
نام django-swapfield
نسخه کتابخانه 0.1.1
نگهدارنده []
ایمیل نگهدارنده []
نویسنده Jose ER
ایمیل نویسنده srj9es@gmail.com
آدرس صفحه اصلی https://github.com/SRJ9/django-swapfield.git
آدرس اینترنتی https://pypi.org/project/django-swapfield/
مجوز MIT
|Build Status| django-swapfield ================ | Easy! When you use django-swapfield if the value is saved in other record, values are swapped! You can configure what | conditions must be repeated in both records to make the change. How to ====== | ~~~~ {.sourceCode .bash} | $ pip install django-swapfield | $ # Define a SwapIntegerField in your model with unique\_for\_fields param (fields coincidence to can swap values) | $ # That SwapIntegerField can’t be a part of unique\_together or unique restriction. | ~~~~ Uses e.g. ========= - Uniform number in sport team. - Race number in an athletic competition. - Any scenario when you want to swap values without reordering. example ======= | ~~~~ {.sourceCode .bash} | from swapfield.fields import SwapIntegerField | class Player(models.Model): | name = models.CharField(max\_length=30) | team = models.ForeignKey(Team) | number = SwapIntegerField(unique\_for\_fields=[‘team’]) | # can swap “number” if “team” has the same value | ~~~~ Available fields ================ - SwapIntegerField Method ====== - Current status allow swap values if not exists unique/unique\_together restriction. First, get the registry (if exists) what contains the new value to assign it the old value from registry what currently is saving. When current registry is saved, replace the other registry with old value. - In next versions, other method will be used when exists unique/unique\_together restriction. to-do list ========== - [ ] Two or more django-swapfield in the same object. - [ ] Alternative method when exists unique/unique\_together restriction - [ ] Friendly validation error with Django Admin (no Fatal error) - [ ] Abstract django-swap-field - [ ] SwapCharField - [x] Tests for functionality - [ ] Tests for migrations - [ ] Config setting to choose swap value when a new record (not edited) get a value that exists in database: choose the max value +1 or the first available. .. |Build Status| image:: https://travis-ci.org/SRJ9/django-swapfield.svg?branch=master :target: https://travis-ci.org/SRJ9/django-swapfield


نحوه نصب


نصب پکیج whl django-swapfield-0.1.1:

    pip install django-swapfield-0.1.1.whl


نصب پکیج tar.gz django-swapfield-0.1.1:

    pip install django-swapfield-0.1.1.tar.gz