Skip to content

Commit

Permalink
Custom Class: methods and properties
Browse files Browse the repository at this point in the history
  • Loading branch information
smcmahon committed May 13, 2011
1 parent 1c2eff6 commit e52bd57
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 4 additions & 1 deletion collective/dexterity_class/everything_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,10 @@ def tooLoud(value):
class EverythingModel(dexterity.Item):
grok.implements(IEverythingModel)

# Add your class methods and properties here
def getCountDown(self):
return str(range(self.integer_field, 0, -1))

count_down = property(getCountDown, doc="Count Down from integer_field")


# View class
Expand Down
2 changes: 2 additions & 0 deletions collective/dexterity_class/everything_model_templates/view.pt
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@
<div tal:content="context/Title">Title inserted here</div>

<div tal:content="context/text_line">Text Line Field Here</div>

<p>Countdown: <span tal:replace="context/count_down"></span></p>

<div class="upperLine" tal:content="view/upperLine">Upper-Case Text Line Field Here</div>

Expand Down

0 comments on commit e52bd57

Please sign in to comment.