comparison doc/design.txt @ 6238:6834bb5473da

Summary: Constrain format of classname and document Define the format of a valid classname. Updated design doc, function doc and glossary to document format. Error message for case where we have a redefinition of a classname now says why ValueError is raised since we are raising ValueError for incorrect classname format as well. Tests for all cases including verification of cause for ValueError exceptions.
author John Rouillard <rouilj@ieee.org>
date Tue, 28 Jul 2020 06:24:39 -0400
parents 5522c950a2e4
children 6f5054751fb6
comparison
equal deleted inserted replaced
6237:0a37979bbd46 6238:6834bb5473da
377 def __init__(self, db, classname, **properties): 377 def __init__(self, db, classname, **properties):
378 """Create a new class with a given name and property 378 """Create a new class with a given name and property
379 specification. 379 specification.
380 380
381 'classname' must not collide with the name of an existing 381 'classname' must not collide with the name of an existing
382 class, or a ValueError is raised. The keyword arguments in 382 class, or a ValueError is raised. 'classname' must start
383 'properties' must map names to property objects, or a 383 with an alphabetic letter. It must end with an
384 TypeError is raised. 384 alphabetic letter or '_'. Internal characters can
385 be alphanumeric or '_'. ValueError is raised if the
386 classname is not correct.
387 The keyword arguments in 'properties' must map names to
388 property objects, or a TypeError is raised.
385 389
386 A proxied reference to the database is available as the 390 A proxied reference to the database is available as the
387 'db' attribute on instances. For example, in 391 'db' attribute on instances. For example, in
388 'IssueClass.send_message', the following is used to lookup 392 'IssueClass.send_message', the following is used to lookup
389 users, messages and files:: 393 users, messages and files::
1739 - "Item" has been renamed to "Issue" to account for the more specific 1743 - "Item" has been renamed to "Issue" to account for the more specific
1740 nature of the Class. 1744 nature of the Class.
1741 - New Templating 1745 - New Templating
1742 - Access Controls 1746 - Access Controls
1743 - Added "actor" property 1747 - Added "actor" property
1748 - 'classname' format specified in class Class.
1744 1749
1745 .. _customisation: customizing.html 1750 .. _customisation: customizing.html
1746 1751

Roundup Issue Tracker: http://roundup-tracker.org/