Mercurial > hg > MPIWGWeb
comparison MPIWGStaff.py @ 208:6d6076e28430
fix deleteField for additionalLink (still ugly though)
| author | casties |
|---|---|
| date | Mon, 01 Jul 2013 18:57:22 +0200 |
| parents | 31b28f369fd3 |
| children | 7791d4fc8a0e |
comparison
equal
deleted
inserted
replaced
| 207:938add25f81b | 208:6d6076e28430 |
|---|---|
| 474 | 474 |
| 475 REQUEST.RESPONSE.redirect(ob.absolute_url()) | 475 REQUEST.RESPONSE.redirect(ob.absolute_url()) |
| 476 | 476 |
| 477 | 477 |
| 478 def getAdditionalLinks(self): | 478 def getAdditionalLinks(self): |
| 479 return self.folder.executeZSQL("SELECT oid,* FROM additionalLink WHERE key_main = %s ORDER BY priority",[self.content.key]) | 479 return self.folder.executeZSQL("SELECT oid,* FROM additionallink WHERE key_main = %s ORDER BY priority",[self.content.key]) |
| 480 | 480 |
| 481 | 481 |
| 482 def getPathStyle(self, path, selected, style=""): | 482 def getPathStyle(self, path, selected, style=""): |
| 483 """returns a string with the given style + 'sel' if path == selected.""" | 483 """returns a string with the given style + 'sel' if path == selected.""" |
| 484 | 484 |
| 749 if not (newEntries[newEntry][mainfield[newEntry]].lstrip().rstrip()==""): | 749 if not (newEntries[newEntry][mainfield[newEntry]].lstrip().rstrip()==""): |
| 750 self.executeZSQL(query) | 750 self.executeZSQL(query) |
| 751 | 751 |
| 752 | 752 |
| 753 | 753 |
| 754 security.declareProtected('View management screens','deleteField') | 754 security.declareProtected('View management screens','deleteField') |
| 755 | |
| 756 def deleteField(self,REQUEST): | 755 def deleteField(self,REQUEST): |
| 757 """delete entry""" | 756 """delete entry""" |
| 758 | 757 # TODO: this is ugly |
| 759 CHANGEABLE=['talks','taching','pubmanbiblio'] | 758 CHANGEABLE=['talks','teaching','pubmanbiblio','additionallink'] |
| 760 | |
| 761 | |
| 762 | 759 |
| 763 table = REQUEST.form.get('table',None); | 760 table = REQUEST.form.get('table',None); |
| 764 oid = REQUEST.form.get('oid',None); | 761 oid = REQUEST.form.get('oid',None); |
| 765 | 762 |
| 766 | 763 |
| 770 oid = REQUEST.form.get('key',None); | 767 oid = REQUEST.form.get('key',None); |
| 771 | 768 |
| 772 if table is None or oid is None: | 769 if table is None or oid is None: |
| 773 return | 770 return |
| 774 | 771 |
| 775 query="DELETE FROM %s WHERE oid = '%s'"%(table,oid) | 772 query="DELETE FROM %s WHERE oid = %%s"%(table) |
| 776 | 773 self.executeZSQL(query, [oid]) |
| 777 self.executeZSQL(query) | 774 |
| 778 REQUEST.response.redirect(self.REQUEST['HTTP_REFERER']) | 775 REQUEST.response.redirect(self.REQUEST['HTTP_REFERER']) |
| 779 | 776 |
| 780 | 777 |
| 781 def invalidate_cache(self): | 778 def invalidate_cache(self): |
| 782 #TODO: How to invalidate the varnish cache from the member object | 779 #TODO: How to invalidate the varnish cache from the member object |
