comparison MoinMoin/items/__init__.py @ 1003:8621c3e273a1

fixes #72. Implements the page to handle 404 error, and calls abort(404) in some view, when apropriate.
author Bruno Martin <bruno@hacklab.com.br>
date Fri, 28 Oct 2011 19:32:53 -0200
parents 5bf6d7a2ffcf
children 9fd0a6a988bb
comparison
equal deleted inserted replaced
978:c2879c9331f9 1003:8621c3e273a1
606 def name_initial(self, names=None): 606 def name_initial(self, names=None):
607 initials = [(name[1][0]) 607 initials = [(name[1][0])
608 for name in names] 608 for name in names]
609 return initials 609 return initials
610 610
611 delete_template = 'delete.html'
612 destroy_template = 'destroy.html'
613 diff_template = 'diff.html'
614 rename_template = 'rename.html'
615 revert_template = 'revert.html'
616
611 class NonExistent(Item): 617 class NonExistent(Item):
612 def do_get(self, force_attachment=False, mimetype=None): 618 def do_get(self, force_attachment=False, mimetype=None):
613 abort(404) 619 abort(404)
614 620
615 def _convert(self): 621 def _convert(self):
692 item_name=self.name, 698 item_name=self.name,
693 rows_meta=str(ROWS_META), cols=str(COLS), 699 rows_meta=str(ROWS_META), cols=str(COLS),
694 help=self.modify_help, 700 help=self.modify_help,
695 form=form, 701 form=form,
696 ) 702 )
697
698 delete_template = 'delete.html'
699 destroy_template = 'destroy.html'
700 diff_template = 'diff.html'
701 rename_template = 'rename.html'
702 revert_template = 'revert.html'
703 703
704 def _render_data_diff(self, oldrev, newrev): 704 def _render_data_diff(self, oldrev, newrev):
705 hash_name = HASH_ALGORITHM 705 hash_name = HASH_ALGORITHM
706 if oldrev.meta[hash_name] == newrev.meta[hash_name]: 706 if oldrev.meta[hash_name] == newrev.meta[hash_name]:
707 return _("The items have the same data hash code (that means they very likely have the same data).") 707 return _("The items have the same data hash code (that means they very likely have the same data).")