74 |
self.type = '' |
self.type = '' |
75 |
self.__dict__.update(attrs) |
self.__dict__.update(attrs) |
76 |
if getChildSchema != None: |
if getChildSchema != None: |
77 |
self.getChildSchema = getChildSchema |
self._getChildSchema = getChildSchema |
78 |
|
|
79 |
def __cmp__(self, other): |
def __cmp__(self, other): |
80 |
if not isinstance(other, Schema): |
if not isinstance(other, Schema): |
84 |
else: |
else: |
85 |
return cmp(string.lower(self.name), string.lower(other.name)) or 1 |
return cmp(string.lower(self.name), string.lower(other.name)) or 1 |
86 |
|
|
87 |
|
def fields(self): |
88 |
|
return self._getChildSchema(self) |
89 |
|
|
90 |
|
# TODO: Last supported in 0.5.2... Delete before 1.0 |
91 |
def getChildSchema(self, parent): |
def getChildSchema(self, parent): |
92 |
|
print "WARNING: Your application is calling Schema.getChildSchema(parent), which has been deprecated in favor of Schema.fields()" |
93 |
|
return self.fields() |
94 |
|
|
95 |
|
def _getChildSchema(self, parent): |
96 |
return () |
return () |
97 |
|
|
98 |
|
|
99 |
|
|
100 |
|
|
101 |
|
|
102 |
|
|