Ticket #399 (closed enhancement: fixed)

Opened 5 years ago

Last modified 5 years ago

axiom.item.Item should default typeName to a normalized version of the qualified Python class name

Reported by: exarkun Assigned to: glyph
Priority: low Milestone:
Component: Axiom Severity: minor
Keywords: Cc:
Estimated Completion (YYYY/MM/DD): Branch:
Author:

Description

This will reduce the boilerplate required to write a new Axiom Item class. schemaVersion will only need to be provided when a class is moved or renamed. Axiom should expose the normalization function, so that when typeName must be added to an existing class, it can be added as normalize('package.module.ClassName?').

Attachments

diff-ru-1.patch (16.2 kB) - added by tekNico on 12/26/05 06:05:48.
Patch for #398 and #399

Change History

11/28/05 09:31:03 changed by exarkun

  • component changed from Addressbook to Axiom.

12/26/05 06:05:48 changed by tekNico

  • attachment diff-ru-1.patch added.

Patch for #398 and #399

12/26/05 06:14:15 changed by tekNico

The attached "diff -ru" patch tries to fix both #398 and #399 issues. I added a normalize function, and changed the MetaItem metaclass, in the source:trunk/Axiom/axiom/item.py file. Then I removed the typeName and schemaVersion specifications from almost all Axiom tests and examples, and checked that they still pass (no worse than before, at least). I'll leave changing the rest of the code to you. :-)

12/26/05 19:28:32 changed by exarkun

  • status changed from new to closed.
  • resolution set to fixed.

(In [3789]) Apply non-test portions of tekNico's typeName/schemaVersion patch

Fixes #398, #399 Author: tekNiko Reviewer: exarkun

This makes typeName and schemaVersion optional, providing default values of a normalized form of the class name and 1, respectively.

The test changes have been omitted as they are unnecessary and cause breakage in the test suite (by changing the name of a type persisted in a historic database).

12/27/05 03:13:24 changed by tekNico

It's great that you liked the patch.

I still have one doubt, though: if you don't change at least one test, how do you know the patch works? :-)

jethro@divmod.org