1 2 3 4 5 | from django.db import models
class NormalTextField(models.Field):
def db_type(self):
return 'text'
|
More like this
- FCKEditor replace all vLargeTextField in admin by aronchi 4 years, 7 months ago
- ByteSplitterField by Lacour 1 year, 9 months ago
- Custom ImageField filename by allieus 2 years, 11 months ago
- Serializing booleans correctly when doing dumpdata from a MySQL database using Django 0.96 by chrj 4 years, 9 months ago
- Modifying the fields of a third/existing model class by marinho 2 years, 4 months ago
Comments
Hi,
Always use ''.replace() instead of re.sub() when the value to find is not a pattern. Replace method is roughly ten times faster.
In your snippet :
Becomes
with regards :-)
#