Painting Web Applications
Adding Attributes
The DVD class certainly doesn't have much character about it, does it? You'll make it much more interesting by adding attributes to the class that capture the characteristics of a DVD. Just like in the last article, the attributes will include a DVD number (so you can find it on the shelf), a running time (in minutes), a rating (so you can keep your kids from seeing Grindhouse until they're 17, for example), and a selection of genres to which the movie belongs.
To add an attribute, click the Properties section at the bottom of the window and then click the "New Attribute" button, as shown below:

For the first attribute, enter the name dvdNumber and leave the data type as int. Then, click the Tagged Values section and annotate this attribute with the values shown below:

Your DVD class now has a place to store the number of the DVD. Now, return to the Properties section of the dvdNumber attribute and click the "Go Up" button as shown below:

This button navigates you up out of the attribute and back into the DVD class where you can then add more attributes with the "New Attribute" button. Add three more attributes as outlined below:
- Add runningTime as an int with the following tagged values:
- Add rating as a String with the following tagged values:
- Add genre as a String with the following tagged values:
| Tag | Value |
|---|---|
| required | python:False |
| widget | IntegerWidget |
| widget:label | Running Time |
| widget:description | Length of the movie in minutes |
| Tag | Value |
|---|---|
| required | python:False |
| index | FieldIndex |
| vocabulary | ['G', 'PG', 'PG-13', 'R', 'NC-17'] |
| widget | SelectionWidget |
| widget:label | Rating |
| widget:description | MPAA rating assigned to the movie |
| Tag | Value |
|---|---|
| required | python:True |
| index | FieldIndex |
| vocabulary | ['Action/Adventure', 'Comedy', 'Drama', 'Family', 'Romance', 'Spaghetti Western'] |
| multiValued | python:True |
| widget | MultiSelectionWidget |
| widget:label | Genre |
| widget:description | Artistic style of the movie |
| widget:format | checkbox |
You're done with the DVD class! In your UML tool, you should have a single class that looks something like this:

Wait! There's no "title" attribute! Where do you place the name of the movie? As with the last article, the title attribute comes automatically. You don't have to put one in manually. Just about every object in Plone has a title of some sort.



Solid state disks (SSDs) made a splash in consumer technology, and now the technology has its eyes on the enterprise storage market. Download this eBook to see what SSDs can do for your infrastructure and review the pros and cons of this potentially game-changing storage technology.