Skip to content

Commit

Permalink
Merge branch 'master' of github.com:arskom/spyne
Browse files Browse the repository at this point in the history
  • Loading branch information
plq committed Oct 22, 2013
2 parents 5ce8d8a + f185e44 commit d782415
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions spyne/model/primitive.py
Expand Up @@ -443,6 +443,17 @@ def validate_native(cls, value):
"""The arbitrary-size unsigned integer, alias for UnsignedInteger."""


class PositiveInteger(NonNegativeInteger):

"""The arbitrary-size positive integer (natural number)."""

__type_name__ = 'positiveInteger'

@staticmethod
def validate_native(cls, value):
return (Integer.validate_native(cls, value)
and (value is None or value > 0))

@memoize
def TBoundedInteger(num_bits, type_name):
_min_b = -(0x8<<(num_bits-4)) # 0x8 is 4 bits.
Expand Down

0 comments on commit d782415

Please sign in to comment.