mirror of
https://github.com/django/django.git
synced 2025-08-01 17:42:56 +00:00
Fixed #22537 -- Add tests and improved docs for field subclass with choices.
This commit is contained in:
parent
8ec388a69d
commit
7fd1b35ed7
4 changed files with 30 additions and 5 deletions
|
@ -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)):
|
||||
"""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue