Back to index

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

List of all members.

Public Member Functions

def to_python
def to_url

Public Attributes

 fixed_digits
 min
 max
 map

Static Public Attributes

string regex = r'\d+'
 num_convert = int
 is_greedy = False
int weight = 100

Detailed Description

This converter only accepts integer values::

    Rule('/page/<int:page>')

This converter does not support negative values.

:param map: the :class:`Map`.
:param fixed_digits: the number of fixed digits in the URL.  If you set
                     this to ``4`` for example, the application will
                     only match if the url looks like ``/0001/``.  The
                     default is variable length.
:param min: the minimal value.
:param max: the maximal value.

Definition at line 850 of file routing.py.


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 866 of file routing.py.

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

Definition at line 865 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: