Changeset 6066
- Timestamp:
- 09/08/07 00:11:17 (1 year ago)
- Files:
-
- django/trunk/django/db/models/fields/__init__.py (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
django/trunk/django/db/models/fields/__init__.py
r6065 r6066 1 import datetime 2 import os 3 import time 4 try: 5 import decimal 6 except ImportError: 7 from django.utils import _decimal as decimal # for Python 2.3 8 1 9 from django.db import get_creation_module 2 10 from django.db.models import signals … … 13 21 from django.utils.encoding import smart_unicode, force_unicode, smart_str 14 22 from django.utils.maxlength import LegacyMaxlength 15 import datetime, os, time16 try:17 import decimal18 except ImportError:19 from django.utils import _decimal as decimal # for Python 2.320 23 21 24 class NOT_PROVIDED: … … 383 386 def save_form_data(self, instance, data): 384 387 setattr(instance, self.name, data) 385 388 386 389 def formfield(self, form_class=forms.CharField, **kwargs): 387 390 "Returns a django.newforms.Field instance for this database Field." … … 786 789 if data: 787 790 getattr(instance, "save_%s_file" % self.name)(data.filename, data.content, save=False) 788 791 789 792 def formfield(self, **kwargs): 790 793 defaults = {'form_class': forms.FileField} 791 # If a file has been provided previously, then the form doesn't require 794 # If a file has been provided previously, then the form doesn't require 792 795 # that a new file is provided this time. 793 796 if 'initial' in kwargs:
