Back to index

moin  1.9.0~rc2
Public Member Functions | Public Attributes | Static Public Attributes
MoinMoin.support.werkzeug.routing.NumberConverter Class Reference
Inheritance diagram for MoinMoin.support.werkzeug.routing.NumberConverter:
Inheritance graph
[legend]
Collaboration diagram for MoinMoin.support.werkzeug.routing.NumberConverter:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def __init__
def to_python
def to_url

Public Attributes

 fixed_digits
 min
 max
 map

Static Public Attributes

string regex = '[^/]+'
 is_greedy = False
int weight = 100

Detailed Description

Baseclass for `IntegerConverter` and `FloatConverter`.

:internal:

Definition at line 822 of file routing.py.


Constructor & Destructor Documentation

def MoinMoin.support.werkzeug.routing.NumberConverter.__init__ (   self,
  map,
  fixed_digits = 0,
  min = None,
  max = None 
)

Definition at line 828 of file routing.py.

00828 
00829     def __init__(self, map, fixed_digits=0, min=None, max=None):
00830         BaseConverter.__init__(self, map)
00831         self.fixed_digits = fixed_digits
00832         self.min = min
00833         self.max = max


Member Function Documentation

Reimplemented from MoinMoin.support.werkzeug.routing.BaseConverter.

Definition at line 834 of file routing.py.

00834 
00835     def to_python(self, value):
00836         if (self.fixed_digits and len(value) != self.fixed_digits):
00837             raise ValidationError()
00838         value = self.num_convert(value)
00839         if (self.min is not None and value < self.min) or \
00840            (self.max is not None and value > self.max):
00841             raise ValidationError()
00842         return value

Reimplemented from MoinMoin.support.werkzeug.routing.BaseConverter.

Definition at line 843 of file routing.py.

00843 
00844     def to_url(self, value):
00845         value = self.num_convert(value)
00846         if self.fixed_digits:
00847             value = ('%%0%sd' % self.fixed_digits) % value
00848         return str(value)
00849 


Member Data Documentation

Definition at line 830 of file routing.py.

Reimplemented in MoinMoin.support.werkzeug.routing.PathConverter.

Definition at line 741 of file routing.py.

Definition at line 745 of file routing.py.

Definition at line 832 of file routing.py.

Definition at line 831 of file routing.py.

string MoinMoin.support.werkzeug.routing.BaseConverter.regex = '[^/]+' [static, inherited]

Reimplemented in MoinMoin.support.werkzeug.routing.PathConverter.

Definition at line 742 of file routing.py.


The documentation for this class was generated from the following file: