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:
@@ -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)):
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user