Back to index

plone3  3.1.7
Private Member Functions
CMFDefault.browser.link.LinkURIWidget Class Reference
Inheritance diagram for CMFDefault.browser.link.LinkURIWidget:
Inheritance graph
[legend]
Collaboration diagram for CMFDefault.browser.link.LinkURIWidget:
Collaboration graph
[legend]

List of all members.

Private Member Functions

def _toFieldValue

Detailed Description

Custom widget for remote_url.

Definition at line 74 of file link.py.


Member Function Documentation

def CMFDefault.browser.link.LinkURIWidget._toFieldValue (   self,
  input 
) [private]

Definition at line 79 of file link.py.

00079 
00080     def _toFieldValue(self, input):
00081         value = super(LinkURIWidget, self)._toFieldValue(input)
00082         if not value:
00083             return value
00084         tokens = urlparse.urlparse(value, 'http')
00085         if tokens[0] == 'http':
00086             if tokens[1]:
00087                 # We have a nethost. All is well.
00088                 return urlparse.urlunparse(tokens)
00089             elif tokens[2:] == ('', '', '', ''):
00090                 # Empty URL
00091                 return u''
00092             else:
00093                 # Relative URL, keep it that way, without http:
00094                 tokens = ('', '') + tokens[2:]
00095                 return urlparse.urlunparse(tokens)
00096         else:
00097             # Other scheme, keep original
00098             return urlparse.urlunparse(tokens)
00099 


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