Monday 12 July 2004 3:03:12 am
eZ community members,
I was creating a new class this afternoon with eZ publish (3.4.0). The class is a todo item. The todo item class was very simple to create and worked right away. After I got the class working. I realized one of the attributes (order) which is a integer (number) wasn't quite what I wanted. What I really wanted was the order attribute to be an auto incrementing number. For example, for each instantiation of the class as an object in a folder would get the last number used for the order attribute from the last todo created and increment number by 1. If it was the first todo then start with 1. Ideally I thought a todo item's order would be based first on the order of the last created order unique to each folder of todo items. Which would allow for different folders or "lists" of todo items each with their own orders. If no other todo items exist in a folder the order would start with 1 and with each new todo item created the new todo item's order would go up by 1. The more I think about it. My idea for an auto increment (unique to folder) integer dataytpe may not be entirely well thought out. In a real life todo list the order of a item may be an auto incrementing number, that can be altered by the user to allow for reordering the list.
I am not entirely sure that such a feature doesn't already exist. I did several searches in the documentation and forums for the keywords: auto, increment, number. So far I have not found any mentions of this kind of feature, or where in eZ publish such a feature would be best implemented. I am posting this evening to see just what others might have to say about my idea. Perhaps I'm not looking in the right place, or I'm looking at the problem the wrong way, or such a feature doesn't yet exist and they could suggest the "eZ way" for me to work on creating the desired feature. Any suggestions or comments on my idea would greatly be appreciated.
Respectfully, Graham "the kracker" Brookins FYI, here is some information on my todo class. Todo Class Example:
- Name (Text line)
- Description (XML Text field)
- Order (Integer / Auto Increment Number)
- Date (Date field)
- Due Date (Date field)
- Status (Selection)
- Priority (Selection) - Area (Selection)
Member since: 2001.07.13 || http://ezpedia.se7enx.com/
|