1
0
mirror of https://github.com/django/django.git synced 2025-10-24 06:06:09 +00:00

Fixed #22537 -- Add tests and improved docs for field subclass with choices.

This commit is contained in:
Mike Fogel
2014-04-11 23:58:56 -04:00
committed by Tim Graham
parent 8ec388a69d
commit 7fd1b35ed7
4 changed files with 30 additions and 5 deletions

View File

@@ -20,6 +20,11 @@ class Small(object):
def __str__(self):
return '%s%s' % (force_text(self.first), force_text(self.second))
def __eq__(self, other):
if isinstance(other, self.__class__):
return self.first == other.first and self.second == other.second
return False
class SmallField(six.with_metaclass(models.SubfieldBase, models.Field)):
"""