Back to index

plone3  3.1.7
Classes | Functions | Variables
Archetypes.Field Namespace Reference

Classes

class  Field
class  ObjectField
class  StringField
class  FileField
class  TextField
class  DateTimeField
class  LinesField
class  IntegerField
class  FloatField
class  FixedPointField
class  ReferenceField
class  ComputedField
class  BooleanField
class  CMFObjectField
class  Image
class  ImageField
class  DynVariantWrapper
class  DynVariant
class  ScalableImage
class  PhotoField

Functions

def encode
def decode

Variables

 FILE_NORMALIZER = True
 HAS_PIL = False
 PIL_ALGO = None
list STRING_TYPES = [StringType, UnicodeType]
list _marker = []
int CHUNK = 1
string __docformat__ = 'reStructuredText'
int _field_count = 0
tuple __all__
string title = 'String'
string description = 'Used for storing simple strings'

Function Documentation

def Archetypes.Field.decode (   value,
  instance,
  kwargs 
)
ensure value is an unicode string

Definition at line 133 of file Field.py.

00133 
00134 def decode(value, instance, **kwargs):
00135     """ensure value is an unicode string"""
00136     if isinstance(value, str):
00137         encoding = kwargs.get('encoding')
00138         if encoding is None:
00139             try:
00140                 encoding = instance.getCharset()
00141             except AttributeError:
00142                 # that occurs during object initialization
00143                 # (no acquisition wrapper)
00144                 encoding = 'UTF8'
00145         value = unicode(value, encoding)
00146     return value

Here is the caller graph for this function:

def Archetypes.Field.encode (   value,
  instance,
  kwargs 
)
ensure value is an encoded string

Definition at line 119 of file Field.py.

00119 
00120 def encode(value, instance, **kwargs):
00121     """ensure value is an encoded string"""
00122     if isinstance(value, unicode):
00123         encoding = kwargs.get('encoding')
00124         if encoding is None:
00125             try:
00126                 encoding = instance.getCharset()
00127             except AttributeError:
00128                 # that occurs during object initialization
00129                 # (no acquisition wrapper)
00130                 encoding = 'UTF8'
00131         value = value.encode(encoding)
00132     return value

Here is the caller graph for this function:


Variable Documentation

Initial value:
00001 ('Field', 'ObjectField', 'StringField',
00002            'FileField', 'TextField', 'DateTimeField', 'LinesField',
00003            'IntegerField', 'FloatField', 'FixedPointField',
00004            'ReferenceField', 'ComputedField', 'BooleanField',
00005            'CMFObjectField', 'ImageField', 'PhotoField',
00006            )

Definition at line 2801 of file Field.py.

string Archetypes.Field.__docformat__ = 'reStructuredText'

Definition at line 116 of file Field.py.

Definition at line 147 of file Field.py.

Definition at line 113 of file Field.py.

Definition at line 114 of file Field.py.

tuple Archetypes.Field.description = 'Used for storing simple strings'

Definition at line 2811 of file Field.py.

Definition at line 94 of file Field.py.

Definition at line 104 of file Field.py.

Definition at line 105 of file Field.py.

list Archetypes.Field.STRING_TYPES = [StringType, UnicodeType]

Definition at line 110 of file Field.py.

string Archetypes.Field.title = 'String'

Definition at line 2810 of file Field.py.