Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixed #1213 -- Changed value of NOT_PROVIDED so that it's not a strin…

…g, to prevent possible (but highly unlikely) collisions. Thanks, akaihola

git-svn-id: http://code.djangoproject.com/svn/django/trunk@2454 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 6d9f4e4ef65b6f8678bb3e8a40b784b4819aa97a 1 parent 6330e28
Adrian Holovaty adrianholovaty authored
Showing with 4 additions and 4 deletions.
  1. +4 −4 django/core/meta/fields.py
8 django/core/meta/fields.py
View
@@ -6,8 +6,8 @@
from django.utils.translation import gettext_lazy, ngettext
import datetime, os
-# Random entropy string used by "default" param.
-NOT_PROVIDED = 'oijpwojefiojpanv'
+class NOT_PROVIDED:
+ pass
# Values for filter_interface.
HORIZONTAL, VERTICAL = 1, 2
@@ -193,11 +193,11 @@ def get_db_prep_lookup(self, lookup_type, value):
def has_default(self):
"Returns a boolean of whether this field has a default value."
- return self.default != NOT_PROVIDED
+ return self.default is not NOT_PROVIDED
def get_default(self):
"Returns the default value for this field."
- if self.default != NOT_PROVIDED:
+ if self.default is not NOT_PROVIDED:
if hasattr(self.default, '__get_value__'):
return self.default.__get_value__()
return self.default
Please sign in to comment.
Something went wrong with that request. Please try again.