Skip to content

Commit

Permalink
new instance based validation
Browse files Browse the repository at this point in the history
  • Loading branch information
joamag committed Jul 27, 2015
1 parent 69c9f5c commit b17518e
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/quorum/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -664,8 +664,9 @@ def links(cls):
for name in methods:
method = getattr(cls, name)
if not hasattr(method, "_link"): continue
is_instance = isinstance(method, types.FunctionType)
method._link.instance = is_instance
reference = hasattr(method, "__self__") and method.__self__
is_instance = False if reference else True
method._link["instance"] = is_instance
links.append(method._link)

# sorts the various links taking into account the name of
Expand Down Expand Up @@ -729,6 +730,9 @@ def operations(cls):
for name in methods:
method = getattr(cls, name)
if not hasattr(method, "_operation"): continue
reference = hasattr(method, "__self__") and method.__self__
is_instance = False if reference else True
method._operation["instance"] = is_instance
operations.append(method._operation)

# sorts the various operations taking into account the name of
Expand Down

0 comments on commit b17518e

Please sign in to comment.