Back to index

plone3  3.1.7
Public Member Functions
Archetypes.interfaces._schema.ICompositeSchema Class Reference
Inheritance diagram for Archetypes.interfaces._schema.ICompositeSchema:
Inheritance graph
[legend]
Collaboration diagram for Archetypes.interfaces._schema.ICompositeSchema:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def getSchemas
def addSchemas
def edit
def setDefaults
def updateAll
def allow
def validate
def toString
def signature
def changeSchemataForField
def getSchemataNames
def getSchemataFields
def replaceField
def moveField
def getName
def __add__
def copy
def fields
def widgets
def filterFields
def __setitem__
def addField
def updateField
def __delitem__
def delField
def __getitem__
def get
def has_key
def keys
def searchable

Detailed Description

A composite schema that delegates to underlying ones

Definition at line 162 of file _schema.py.


Member Function Documentation

Add two schematas

Definition at line 9 of file _schema.py.

00009 
00010     def __add__(other):
00011         """Add two schematas"""

Delete field by name ``name`` 

Definition at line 49 of file _schema.py.

00049 
00050     def __delitem__(name):
00051         """Delete field by name ``name`` """

Get field by name.

Raises KeyError if the field does not exist.

Definition at line 55 of file _schema.py.

00055 
00056     def __getitem__(name):
00057         """Get field by name.
00058 
00059         Raises KeyError if the field does not exist.
00060         """

Here is the caller graph for this function:

def Archetypes.interfaces._schema.ISchemata.__setitem__ (   name,
  field 
) [inherited]
Add a field under key ``name`` (possibly
overriding an existing one)

Definition at line 38 of file _schema.py.

00038 
00039     def __setitem__(name, field):
00040         """Add a field under key ``name`` (possibly
00041         overriding an existing one)
00042         """

Here is the caller graph for this function:

Add a field (possibly overriding an existing one)

Definition at line 43 of file _schema.py.

00043 
00044     def addField(field):
00045         """Add a field (possibly overriding an existing one)"""

Here is the caller graph for this function:

Append schemas to composite

Definition at line 168 of file _schema.py.

00168 
00169     def addSchemas(schemas):
00170         """Append schemas to composite"""

def Archetypes.interfaces._schema.ISchema.allow (   name) [inherited]
Check if a field by the given name exists

Definition at line 104 of file _schema.py.

00104 
00105     def allow(name):
00106         """Check if a field by the given name exists"""

Here is the caller graph for this function:

def Archetypes.interfaces._schema.ISchema.changeSchemataForField (   fieldname,
  schemataname 
) [inherited]
Change the schemata for a field 

Definition at line 131 of file _schema.py.

00131 
00132     def changeSchemataForField(fieldname, schemataname):
00133         """Change the schemata for a field """

Return a deep copy

Definition at line 12 of file _schema.py.

00012 
00013     def copy():
00014         """Return a deep copy"""

Here is the caller graph for this function:

Delete field by name ``name`` 

Definition at line 52 of file _schema.py.

00052 
00053     def delField(name):
00054         """Delete field by name ``name`` """

def Archetypes.interfaces._schema.ISchema.edit (   instance,
  name,
  value 
) [inherited]
Schema 
Call the mutator by name on instance,
setting the value.

Definition at line 82 of file _schema.py.

00082 
00083     def edit(instance, name, value):
00084         """Call the mutator by name on instance,
00085         setting the value.
00086         """

Here is the caller graph for this function:

Return a list of fields

Definition at line 15 of file _schema.py.

00015 
00016     def fields():
00017         """Return a list of fields"""

Here is the caller graph for this function:

def Archetypes.interfaces._schema.ISchemata.filterFields (   predicates,
  values 
) [inherited]
Returns a subset of self.fields(), containing only fields that
satisfy the given conditions.

You can either specify predicates or values or both. If you provide
both, all conditions must be satisfied.

For each ``predicate`` (positional argument), ``predicate(field)`` must
return 1 for a Field ``field`` to be returned as part of the result.

Each ``attr=val`` function argument defines an additional predicate:
A field must have the attribute ``attr`` and field.attr must be equal
to value ``val`` for it to be in the returned list.

Definition at line 23 of file _schema.py.

00023 
00024     def filterFields(*predicates, **values):
00025         """Returns a subset of self.fields(), containing only fields that
00026         satisfy the given conditions.
00027 
00028         You can either specify predicates or values or both. If you provide
00029         both, all conditions must be satisfied.
00030 
00031         For each ``predicate`` (positional argument), ``predicate(field)`` must
00032         return 1 for a Field ``field`` to be returned as part of the result.
00033 
00034         Each ``attr=val`` function argument defines an additional predicate:
00035         A field must have the attribute ``attr`` and field.attr must be equal
00036         to value ``val`` for it to be in the returned list.
00037         """

Here is the caller graph for this function:

def Archetypes.interfaces._schema.ISchemata.get (   name,
  default = None 
) [inherited]
Get field by name, using a default value
for missing

Definition at line 61 of file _schema.py.

00061 
00062     def get(name, default=None):
00063         """Get field by name, using a default value
00064         for missing
00065         """

Here is the caller graph for this function:

Return Schemata name

Definition at line 6 of file _schema.py.

00006 
00007     def getName():
00008         """Return Schemata name"""

Here is the caller graph for this function:

A composite schema that delegates to underlying ones
Return a list of underlying schemas in order

Definition at line 165 of file _schema.py.

00165 
00166     def getSchemas():
00167         """Return a list of underlying schemas in order"""

Here is the caller graph for this function:

Return list of fields belong to schema 'name'
in order of appearing

Definition at line 137 of file _schema.py.

00137 
00138     def getSchemataFields(name):
00139         """Return list of fields belong to schema 'name'
00140         in order of appearing
00141         """

Here is the caller graph for this function:

Return list of schemata names in order of appearing

Definition at line 134 of file _schema.py.

00134 
00135     def getSchemataNames():
00136         """Return list of schemata names in order of appearing"""

Here is the caller graph for this function:

Check if a field by the given name exists

Definition at line 66 of file _schema.py.

00066 
00067     def has_key(name):
00068         """Check if a field by the given name exists"""

Here is the caller graph for this function:

Return the names of the fields present
on this schema

Definition at line 69 of file _schema.py.

00069 
00070     def keys():
00071         """Return the names of the fields present
00072         on this schema"""

Here is the caller graph for this function:

def Archetypes.interfaces._schema.ISchema.moveField (   name,
  direction = None,
  pos = None,
  after = None,
  before = None 
) [inherited]
Move a field

name:
    name of the field
direction:
    Move a field inside its schemata to the left (-1) or to the right (+1)
pos:
    Moves a field to a position in the whole schema. pos is either a number
    or 'top' or 'bottom'
after:
    Moves the field 'name' after the field 'after'
before:
    Moves the field 'name' before the field 'before'

Definition at line 145 of file _schema.py.

00145 
00146     def moveField(name, direction=None, pos=None, after=None, before=None):
00147         """Move a field
00148         
00149         name:
00150             name of the field
00151         direction:
00152             Move a field inside its schemata to the left (-1) or to the right (+1)
00153         pos:
00154             Moves a field to a position in the whole schema. pos is either a number
00155             or 'top' or 'bottom'
00156         after:
00157             Moves the field 'name' after the field 'after'
00158         before:
00159             Moves the field 'name' before the field 'before'
00160          
00161         """

def Archetypes.interfaces._schema.ISchema.replaceField (   name,
  field 
) [inherited]
Replace field under ``name`` with ``field``

Definition at line 142 of file _schema.py.

00142 
00143     def replaceField(name, field):
00144         """Replace field under ``name`` with ``field``"""
        
Return a list containing names of all
the fields present on this schema that are
searchable.

Definition at line 73 of file _schema.py.

00073 
00074     def searchable():
00075         """Return a list containing names of all
00076         the fields present on this schema that are
00077         searchable.
00078         """

def Archetypes.interfaces._schema.ISchema.setDefaults (   instance) [inherited]
Only call during object initialization.

Sets fields to schema defaults.

Definition at line 87 of file _schema.py.

00087 
00088     def setDefaults(instance):
00089         """Only call during object initialization.
00090 
00091         Sets fields to schema defaults.
00092         """

Here is the caller graph for this function:

Return an md5 sum of the the schema.

This is used for determining whether a schema
has changed in the auto update function.

Definition at line 124 of file _schema.py.

00124 
00125     def signature():
00126         """Return an md5 sum of the the schema.
00127 
00128         This is used for determining whether a schema
00129         has changed in the auto update function.
00130         """

Utility method for converting a Schema to a string for the
purpose of comparing schema.

This is used for determining whether a schema
has changed in the auto update function.

Definition at line 116 of file _schema.py.

00116 
00117     def toString():
00118         """Utility method for converting a Schema to a string for the
00119         purpose of comparing schema.
00120 
00121         This is used for determining whether a schema
00122         has changed in the auto update function.
00123         """

Here is the caller graph for this function:

def Archetypes.interfaces._schema.ISchema.updateAll (   instance,
  kwargs 
) [inherited]
This method mutates fields in the given instance.

For each keyword argument k, the key indicates the name of the
field to mutate while the value is used to call the mutator.

E.g. updateAll(instance, id='123', amount=500) will, depending on the
actual mutators set, result in two calls: ``instance.setId('123')`` and
``instance.setAmount(500)``.

Definition at line 93 of file _schema.py.

00093 
00094     def updateAll(instance, **kwargs):
00095         """This method mutates fields in the given instance.
00096 
00097         For each keyword argument k, the key indicates the name of the
00098         field to mutate while the value is used to call the mutator.
00099 
00100         E.g. updateAll(instance, id='123', amount=500) will, depending on the
00101         actual mutators set, result in two calls: ``instance.setId('123')`` and
00102         ``instance.setAmount(500)``.
00103         """

Update a field (possibly overriding an existing one)

Definition at line 46 of file _schema.py.

00046 
00047     def updateField(field):
00048         """Update a field (possibly overriding an existing one)"""

def Archetypes.interfaces._schema.ISchema.validate (   instance = None,
  REQUEST = None,
  errors = None,
  data = None,
  metadata = None 
) [inherited]
Validate the state of the entire object.

The passed dictionary ``errors`` will be filled with human readable
error messages as values and the corresponding fields' names as
keys.

Definition at line 108 of file _schema.py.

00108 
00109                  errors=None, data=None, metadata=None):
00110         """Validate the state of the entire object.
00111 
00112         The passed dictionary ``errors`` will be filled with human readable
00113         error messages as values and the corresponding fields' names as
00114         keys.
00115         """

Here is the caller graph for this function:

Return a dictionary that contains a widget for
each field, using the field name as key

Definition at line 18 of file _schema.py.

00018 
00019     def widgets():
00020         """Return a dictionary that contains a widget for
00021         each field, using the field name as key
00022         """

Here is the caller graph for this function:


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