Back to index

plone3  3.1.7
Public Member Functions | Public Attributes
plone.app.contentrules.namechooser.RuleNameChooser Class Reference
Inheritance diagram for plone.app.contentrules.namechooser.RuleNameChooser:
Inheritance graph
[legend]
Collaboration diagram for plone.app.contentrules.namechooser.RuleNameChooser:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def __init__
def chooseName

Public Attributes

 context

Detailed Description

A name chooser for content rules.

Definition at line 8 of file namechooser.py.


Constructor & Destructor Documentation

Definition at line 14 of file namechooser.py.

00014 
00015     def __init__(self, context):
00016         self.context = context

Here is the caller graph for this function:


Member Function Documentation

Definition at line 17 of file namechooser.py.

00017 
00018     def chooseName(self, name, object):
00019         container = self.context
00020 
00021         if not name:
00022             name = object.__class__.__name__.lower()
00023 
00024         i = 1
00025         new_name = "%s-%d" % (name, i)
00026         while new_name in container and i <= ATTEMPTS:
00027             i += 1
00028             new_name = "%s-%d" % (name, i)
00029             
00030         self.checkName(new_name, object)
00031         return new_name

Here is the call graph for this function:


Member Data Documentation

Definition at line 15 of file namechooser.py.


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