Skip to content

Commit 9a0b607

Browse files
committed
minor changes.
1 parent 4b4678c commit 9a0b607

File tree

7 files changed

+14
-8
lines changed

7 files changed

+14
-8
lines changed

spyne/protocol/http.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,10 +110,10 @@ def deserialize(self, ctx, message):
110110

111111
if ctx.descriptor.in_header:
112112
ctx.in_header = self.flat_dict_to_object(ctx.in_header_doc,
113-
ctx.descriptor.in_header)
113+
ctx.descriptor.in_header, self.validator)
114114
if ctx.descriptor.in_message:
115115
ctx.in_object = self.flat_dict_to_object(ctx.in_body_doc,
116-
ctx.descriptor.in_message)
116+
ctx.descriptor.in_message, self.validator)
117117

118118
self.event_manager.fire_event('after_deserialize', ctx)
119119

spyne/test/model/test_complex.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -414,7 +414,7 @@ class CCM(ComplexModel):
414414

415415
val = CCM(i=5, s='a', c=CM(i=7, s='b'))
416416

417-
d = DictObject().object_to_flat_dict(CCM, val)
417+
d = DictObject.object_to_flat_dict(CCM, val)
418418

419419
assert d['i'] == 5
420420
assert d['s'] == 'a'

spyne/test/protocol/test_soap.py

100644100755
File mode changed.

spyne/test/protocol/test_xml.py

100644100755
File mode changed.

spyne/test/test_soft_validation.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,6 @@ def __get_ctx(self, mn, qs):
123123
return ctx
124124

125125
def test_http_rpc(self):
126-
127126
ctx = self.__get_ctx('some_method', 's=1')
128127
self.assertEquals(ctx.in_error.faultcode, 'Client.ValidationError')
129128

spyne/test/test_sqlalchemy.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -509,7 +509,7 @@ class SomeClass(TableModel):
509509
__tablename__ = 'some_class'
510510
__table_args__ = {"sqlite_autoincrement": True}
511511

512-
id = Integer32(primary_key=True)
512+
id = Integer32
513513
others = Array(SomeOtherClass, store_as='xml')
514514

515515
get_sqlalchemy_table(SomeClass)

spyne/util/sqlalchemy.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939

4040
from sqlalchemy.dialects.postgresql import FLOAT
4141
from sqlalchemy.dialects.postgresql import DOUBLE_PRECISION
42-
from sqlalchemy.dialects.postgresql import PGUuid
42+
from sqlalchemy.dialects.postgresql.base import PGUuid
4343

4444
from sqlalchemy.ext.compiler import compiles
4545

@@ -181,7 +181,10 @@ def get_sqlalchemy_type(cls):
181181
elif issubclass(cls, Uuid):
182182
return PGUuid
183183

184+
184185
def get_pk_columns(cls):
186+
"""Return primary key fields of a Spyne object."""
187+
185188
retval = []
186189
for k, v in cls._type_info.items():
187190
if v.Attributes.sqla_column_args[-1].get('primary_key', False):
@@ -206,9 +209,10 @@ def _get_col_o2o(k, v):
206209
return Column(fk_col_name, pk_sqla_type, fk)
207210

208211
def _get_col_o2m(cls):
209-
"""Gets parent class, key and child type and returns a column that points to
210-
the primary key of the parent.
212+
"""Gets the parent class and returns a column that points to the primary key
213+
of the parent.
211214
"""
215+
212216
# get pkeys from current class
213217
pk_column, = get_pk_columns(cls) # FIXME: Support multi-col keys
214218

@@ -224,6 +228,9 @@ def _get_col_o2m(cls):
224228
return col
225229

226230
def _get_cols_m2m(cls, k, v):
231+
"""Gets the parent and child classes and returns foreign keys to both
232+
tables. These columns can be used to create a relation table."""
233+
227234
child, = v._type_info.values()
228235
return _get_col_o2m(cls), _get_col_o2o(k, child)
229236

0 commit comments

Comments
 (0)