diff options
| author | Malcolm Tredinnick <malcolm.tredinnick@gmail.com> | 2007-11-29 20:38:41 +0000 |
|---|---|---|
| committer | Malcolm Tredinnick <malcolm.tredinnick@gmail.com> | 2007-11-29 20:38:41 +0000 |
| commit | dfe05d94b853073e2762250e1b4cd64ce9ef1df0 (patch) | |
| tree | 4e6aea30920e85556903dd67ca329fe69e9f2a7d /django/db | |
| parent | b43a0180322b42925c4c27b5ccdf2e876309c53b (diff) | |
queryset-refactor: Merged from trunk up to [6752].
git-svn-id: http://code.djangoproject.com/svn/django/branches/queryset-refactor@6753 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django/db')
| -rw-r--r-- | django/db/models/base.py | 4 | ||||
| -rw-r--r-- | django/db/models/fields/__init__.py | 2 | ||||
| -rw-r--r-- | django/db/models/fields/subclassing.py | 4 |
3 files changed, 5 insertions, 5 deletions
diff --git a/django/db/models/base.py b/django/db/models/base.py index 379ed898f6..6b8e8369b0 100644 --- a/django/db/models/base.py +++ b/django/db/models/base.py @@ -471,5 +471,5 @@ def method_get_order(ordered_obj, self): # HELPER FUNCTIONS (CURRIED MODEL FUNCTIONS) # ############################################## -def get_absolute_url(opts, func, self): - return settings.ABSOLUTE_URL_OVERRIDES.get('%s.%s' % (opts.app_label, opts.module_name), func)(self) +def get_absolute_url(opts, func, self, *args, **kwargs): + return settings.ABSOLUTE_URL_OVERRIDES.get('%s.%s' % (opts.app_label, opts.module_name), func)(self, *args, **kwargs) diff --git a/django/db/models/fields/__init__.py b/django/db/models/fields/__init__.py index af122b33d9..ddff9bde29 100644 --- a/django/db/models/fields/__init__.py +++ b/django/db/models/fields/__init__.py @@ -399,7 +399,7 @@ class Field(object): "Returns a django.newforms.Field instance for this database Field." defaults = {'required': not self.blank, 'label': capfirst(self.verbose_name), 'help_text': self.help_text} if self.choices: - defaults['widget'] = forms.Select(choices=self.get_choices()) + defaults['widget'] = forms.Select(choices=self.get_choices(include_blank=self.blank or not (self.has_default() or 'initial' in kwargs))) if self.has_default(): defaults['initial'] = self.get_default() defaults.update(kwargs) diff --git a/django/db/models/fields/subclassing.py b/django/db/models/fields/subclassing.py index 1e4c8ca2e0..36f7e4d934 100644 --- a/django/db/models/fields/subclassing.py +++ b/django/db/models/fields/subclassing.py @@ -28,10 +28,10 @@ class Creator(object): def __get__(self, obj, type=None): if obj is None: raise AttributeError('Can only be accessed via an instance.') - return self.value + return obj.__dict__[self.field.name] def __set__(self, obj, value): - self.value = self.field.to_python(value) + obj.__dict__[self.field.name] = self.field.to_python(value) def make_contrib(func=None): """ |
