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 1 year, 2 months ago
- Serializing booleans correctly when doing dumpdata from a MySQL database using Django 0.96 by chrj 3 years, 9 months ago
- FCKEditor replace all vLargeTextField in admin by aronchi 3 years, 7 months ago
- TinyIntegerField by Lacour 9 months, 1 week ago
- model instance to sql insert statement by gsoltis 1 year, 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 :-)
#