mirror of
https://github.com/Hopiu/django-model-utils.git
synced 2026-04-25 05:14:43 +00:00
Fix E303 too many blank lines.
This commit is contained in:
parent
9a6634b87a
commit
654e13235e
2 changed files with 0 additions and 13 deletions
|
|
@ -57,7 +57,6 @@ class Choices(object):
|
|||
|
||||
self._process(choices)
|
||||
|
||||
|
||||
def _store(self, triple, triple_collector, double_collector):
|
||||
self._identifier_map[triple[1]] = triple[0]
|
||||
self._display_map[triple[0]] = triple[2]
|
||||
|
|
@ -65,7 +64,6 @@ class Choices(object):
|
|||
triple_collector.append(triple)
|
||||
double_collector.append((triple[0], triple[2]))
|
||||
|
||||
|
||||
def _process(self, choices, triple_collector=None, double_collector=None):
|
||||
if triple_collector is None:
|
||||
triple_collector = self._triples
|
||||
|
|
@ -98,26 +96,21 @@ class Choices(object):
|
|||
else:
|
||||
store((choice, choice, choice))
|
||||
|
||||
|
||||
def __len__(self):
|
||||
return len(self._doubles)
|
||||
|
||||
|
||||
def __iter__(self):
|
||||
return iter(self._doubles)
|
||||
|
||||
|
||||
def __getattr__(self, attname):
|
||||
try:
|
||||
return self._identifier_map[attname]
|
||||
except KeyError:
|
||||
raise AttributeError(attname)
|
||||
|
||||
|
||||
def __getitem__(self, key):
|
||||
return self._display_map[key]
|
||||
|
||||
|
||||
def __add__(self, other):
|
||||
if isinstance(other, self.__class__):
|
||||
other = other._triples
|
||||
|
|
@ -125,29 +118,24 @@ class Choices(object):
|
|||
other = list(other)
|
||||
return Choices(*(self._triples + other))
|
||||
|
||||
|
||||
def __radd__(self, other):
|
||||
# radd is never called for matching types, so we don't check here
|
||||
other = list(other)
|
||||
return Choices(*(other + self._triples))
|
||||
|
||||
|
||||
def __eq__(self, other):
|
||||
if isinstance(other, self.__class__):
|
||||
return self._triples == other._triples
|
||||
return False
|
||||
|
||||
|
||||
def __repr__(self):
|
||||
return '%s(%s)' % (
|
||||
self.__class__.__name__,
|
||||
', '.join(("%s" % repr(i) for i in self._triples))
|
||||
)
|
||||
|
||||
|
||||
def __contains__(self, item):
|
||||
return item in self._db_values
|
||||
|
||||
|
||||
def __deepcopy__(self, memo):
|
||||
return self.__class__(*copy.deepcopy(self._triples, memo))
|
||||
|
|
|
|||
|
|
@ -241,7 +241,6 @@ class FieldTrackerTests(FieldTrackerTestCase, FieldTrackerCommonTests):
|
|||
self.assertFalse(item.tracker.has_changed('number'))
|
||||
|
||||
|
||||
|
||||
class FieldTrackerMultipleInstancesTests(TestCase):
|
||||
|
||||
def test_with_deferred_fields_access_multiple(self):
|
||||
|
|
|
|||
Loading…
Reference in a new issue