Permalink
Browse files

added add method to tuple attr type

  • Loading branch information...
1 parent 5aecb5a commit ae5bbe964177454b11219089b86dde5b73af948c Tim Parkin committed Feb 27, 2009
Showing with 11 additions and 0 deletions.
  1. +11 −0 schemaish/attr.py
View
@@ -217,6 +217,17 @@ def __init__(self, attrs=None, **k):
if attrs is not None:
self.attrs = attrs
+ def add(self, attr):
+ """
+ Add an attribute to the tuple
+
+ @param attr: Attribute type.
+ """
+ if attr is None:
+ self.attrs = [attr]
+ else:
+ self.attrs.append(attr)
+
def validate(self, value):
"""
Validate the tuple's items and the tuple itself.

0 comments on commit ae5bbe9

Please sign in to comment.