Mercurial > p > roundup > code
comparison roundup/hyperdb.py @ 188:1536be43d2fa
Roundupdb now appends "mailing list" information to its messages...
...which include the e-mail address and web interface
address. Templates may override this in their db classes to include
specific information (support instructions, etc).
| author | Richard Jones <richard@users.sourceforge.net> |
|---|---|
| date | Thu, 02 Aug 2001 06:38:17 +0000 |
| parents | c580555a6508 |
| children | d45384bc6420 |
comparison
equal
deleted
inserted
replaced
| 187:0384459b2486 | 188:1536be43d2fa |
|---|---|
| 393 | 393 |
| 394 def getkey(self): | 394 def getkey(self): |
| 395 """Return the name of the key property for this class or None.""" | 395 """Return the name of the key property for this class or None.""" |
| 396 return self.key | 396 return self.key |
| 397 | 397 |
| 398 def labelprop(self): | 398 def labelprop(self, default_to_id=0): |
| 399 ''' Return the property name for a label for the given node. | 399 ''' Return the property name for a label for the given node. |
| 400 | 400 |
| 401 This method attempts to generate a consistent label for the node. | 401 This method attempts to generate a consistent label for the node. |
| 402 It tries the following in order: | 402 It tries the following in order: |
| 403 1. key property | 403 1. key property |
| 411 props = self.getprops() | 411 props = self.getprops() |
| 412 if props.has_key('name'): | 412 if props.has_key('name'): |
| 413 return 'name' | 413 return 'name' |
| 414 elif props.has_key('title'): | 414 elif props.has_key('title'): |
| 415 return 'title' | 415 return 'title' |
| 416 if default_to_id: | |
| 417 return 'id' | |
| 416 props = props.keys() | 418 props = props.keys() |
| 417 props.sort() | 419 props.sort() |
| 418 return props[0] | 420 return props[0] |
| 419 | 421 |
| 420 # TODO: set up a separate index db file for this? profile? | 422 # TODO: set up a separate index db file for this? profile? |
| 796 cl.create(name=option[i], order=i) | 798 cl.create(name=option[i], order=i) |
| 797 return hyperdb.Link(name) | 799 return hyperdb.Link(name) |
| 798 | 800 |
| 799 # | 801 # |
| 800 # $Log: not supported by cvs2svn $ | 802 # $Log: not supported by cvs2svn $ |
| 803 # Revision 1.11 2001/08/01 04:24:21 richard | |
| 804 # mailgw was assuming certain properties existed on the issues being created. | |
| 805 # | |
| 801 # Revision 1.10 2001/07/30 02:38:31 richard | 806 # Revision 1.10 2001/07/30 02:38:31 richard |
| 802 # get() now has a default arg - for migration only. | 807 # get() now has a default arg - for migration only. |
| 803 # | 808 # |
| 804 # Revision 1.9 2001/07/29 09:28:23 richard | 809 # Revision 1.9 2001/07/29 09:28:23 richard |
| 805 # Fixed sorting by clicking on column headings. | 810 # Fixed sorting by clicking on column headings. |
