django-swapfield
================
How to
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
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.
Metadata
Release files for django-swapfield 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| django-swapfield-0.1.1.tar.gz | 7.2 kB | Details |
Release files / django-swapfield-0.1.1.tar.gz
| Download URL | django-swapfield-0.1.1.tar.gz |
|---|---|
| Size | 7.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9e6cd6d4c32d5a0927fa23bf670ebbbc525aa36928b81199c3ac025d23ddfefa
|
|
BLAKE2b-256 checksum How to use checksums |
bef0dcb9ea1d28b43ff2ee1cae6a25c67cad0dc9564f95e508d18fec2f085fc0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |