1 2 3 4 5 | from django.db import models
class NormalTextField(models.Field):
def db_type(self):
return 'text'
|
More like this
- remove the annoying "Hold down control..." messages by arthur 10 months, 3 weeks ago
- Serializing booleans correctly when doing dumpdata from a MySQL database using Django 0.96 by chrj 3 years, 6 months ago
- FCKEditor replace all vLargeTextField in admin by aronchi 3 years, 3 months ago
- TinyIntegerField by Lacour 5 months, 3 weeks ago
- model instance to sql insert statement by gsoltis 1 year, 1 month 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 :-)
#