Back to index

moin  1.9.0~rc2
Public Member Functions | Public Attributes | Static Public Attributes
MoinMoin.support.werkzeug.routing.FloatConverter Class Reference
Inheritance diagram for MoinMoin.support.werkzeug.routing.FloatConverter:
Inheritance graph
[legend]
Collaboration diagram for MoinMoin.support.werkzeug.routing.FloatConverter:
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 = r'\d+\.\d+'
 num_convert = float
 is_greedy = False
int weight = 100

Detailed Description

This converter only accepts floating point values::

    Rule('/probability/<float:probability>')

This converter does not support negative values.

:param map: the :class:`Map`.
:param min: the minimal value.
:param max: the maximal value.

Definition at line 869 of file routing.py.


Constructor & Destructor Documentation

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

Definition at line 883 of file routing.py.

00883 
00884     def __init__(self, map, min=None, max=None):
00885         NumberConverter.__init__(self, map, 0, min, max)
00886 


Member Function Documentation

def MoinMoin.support.werkzeug.routing.NumberConverter.to_python (   self,
  value 
) [inherited]

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

def MoinMoin.support.werkzeug.routing.NumberConverter.to_url (   self,
  value 
) [inherited]

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.

Definition at line 881 of file routing.py.

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

Definition at line 880 of file routing.py.

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: