Permalink
Browse files

500

  • Loading branch information...
1 parent d8d121f commit 75ff220946ef96447bdfee576809d0ddc4e66395 @sorl committed May 21, 2011
Showing with 12 additions and 10 deletions.
  1. +11 −9 README.rst
  2. +1 −1 stringfield/base.py
View
@@ -2,19 +2,16 @@
django-stringfield
==================
-A field intended for strings that 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:
+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)``
-
- MySQL >= 5.0.3 should be able to handle a maximum length of 65535 but that
- does not work in my empirical testing using mysql 5.1.41 where 65528 is the
- maximum considering ``NULL`` and ``NOT NULL``.
+ ``VARCHAR (65528)`` [#f1]_
Oracle
``VARCHAR2 (4000)``
@@ -35,7 +32,7 @@ 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 255
+* It is optional and defaults to 500
* It only enforces max length on the default formfield **not** on the database.
Example::
@@ -46,3 +43,8 @@ Example::
class MyModel(models.Model):
name = StringField()
+
+.. [#f1] MySQL >= 5.0.3 should be able to handle a maximum length of 65535 but
+ that does not work in my empirical testing using mysql 5.1.41 where 65528
+ is the maximum considering ``NULL`` and ``NOT NULL``.
+
View
@@ -7,7 +7,7 @@ class StringField(models.Field):
description = _("String")
def __init__(self, *args, **kwargs):
- kwargs['max_length'] = kwargs.get('max_length', 255)
+ kwargs['max_length'] = kwargs.get('max_length', 500)
super(StringField, self).__init__(*args, **kwargs)
def get_internal_type(self):

0 comments on commit 75ff220

Please sign in to comment.