Django field with automatic values swap
Project description
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.
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
File details
Details for the file django-swapfield-0.1.1.tar.gz
.
File metadata
- Download URL: django-swapfield-0.1.1.tar.gz
- Upload date:
- Size: 7.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9e6cd6d4c32d5a0927fa23bf670ebbbc525aa36928b81199c3ac025d23ddfefa |
|
MD5 | 89e39ede4eabf3e8404f9a4e6ded917f |
|
BLAKE2b-256 | bef0dcb9ea1d28b43ff2ee1cae6a25c67cad0dc9564f95e508d18fec2f085fc0 |