Skip to content

Commit 9f419cd

Browse files
committed
Issue #25: Redundant method has been removed
1 parent 504f74f commit 9f419cd

File tree

1 file changed

+0
-23
lines changed

1 file changed

+0
-23
lines changed

domain_models/views.py

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,9 @@ def validate(mcs, bases, attributes):
1919
"""Check attributes."""
2020
if bases[0] is object:
2121
return None
22-
2322
mcs.check_model_cls(attributes)
2423
mcs.check_include_exclude(attributes)
2524
mcs.check_properties(attributes)
26-
mcs.match_unknown_attrs(attributes)
2725

2826
@staticmethod
2927
def check_model_cls(attributes):
@@ -121,27 +119,6 @@ def get_intersections(mcs, attributes, attr):
121119
properties = mcs.get_properties(attributes)
122120
return list(set(properties).intersection(attr))
123121

124-
@classmethod
125-
def match_unknown_attrs(mcs, attributes):
126-
"""Check about using nonexistent attributes.
127-
128-
:type attributes: dict
129-
"""
130-
model_cls = attributes.get('__model_cls__')
131-
include, exclude = mcs.get_prepared_include_exclude(attributes)
132-
attrs = include if include else exclude
133-
unknown_attr = list()
134-
135-
for attr in attrs:
136-
if not hasattr(model_cls, attr):
137-
unknown_attr.append(attr)
138-
139-
if not unknown_attr:
140-
return None
141-
142-
raise AttributeError(
143-
"Nonexistent attributes: {0}.".format(", ".join(unknown_attr)))
144-
145122

146123
@six.add_metaclass(ContextViewMetaClass)
147124
class ContextView(object):

0 commit comments

Comments
 (0)