A field intended for strings that typically has a length less than 500 characters. django-stringfield tries to not to enforce length on database level if possible but different databases have different limitations. Currently implemented as:
- PostgreSQL
character varying
- MySQL
VARCHAR (65528) [1]
- Oracle
VARCHAR2 (4000)
- SQLite & Other backends
TEXT
Installation
pip install django-stringfield
Usage
You use this just like the normal django.db.models.CharField except that the key word argument max_length works a little differently:
It is optional and defaults to 500
It only enforces max length on the default formfield not on the database.
Example:
# models.py
from stringfield import StringField
class MyModel(models.Model):
name = StringField()
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-stringfield-0.3.0.tar.gz.
File metadata
- Download URL: django-stringfield-0.3.0.tar.gz
- Upload date:
- Size: 4.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d25bdd1438f3e8bc51e97b5f8950a3de4d7944cb3882e2f14893a293881f0501
|
|
| MD5 |
68c3d5383cd5d3087e3e2e91a9d57872
|
|
| BLAKE2b-256 |
fbbc2e01637d7de827567573c9afee05b2d3de07fd2041f57ff2df644f368f8f
|