Mercurial > p > roundup > code
comparison roundup/cgi/templating.py @ 1917:9bf9cf980656
allow negative items, helping construct forms
| author | Richard Jones <richard@users.sourceforge.net> |
|---|---|
| date | Thu, 13 Nov 2003 05:55:01 +0000 |
| parents | f5c804379c85 |
| children | f1e5e5115c29 |
comparison
equal
deleted
inserted
replaced
| 1916:d157b9b56ebf | 1917:9bf9cf980656 |
|---|---|
| 345 | 345 |
| 346 def designator(self): | 346 def designator(self): |
| 347 ''' Return this class' designator (classname) ''' | 347 ''' Return this class' designator (classname) ''' |
| 348 return self._classname | 348 return self._classname |
| 349 | 349 |
| 350 def getItem(self, itemid, num_re=re.compile('\d+')): | 350 def getItem(self, itemid, num_re=re.compile('-?\d+')): |
| 351 ''' Get an item of this class by its item id. | 351 ''' Get an item of this class by its item id. |
| 352 ''' | 352 ''' |
| 353 # make sure we're looking at an itemid | 353 # make sure we're looking at an itemid |
| 354 if not num_re.match(itemid): | 354 if not num_re.match(itemid): |
| 355 itemid = self._klass.lookup(itemid) | 355 itemid = self._klass.lookup(itemid) |
