Left: | ||
Right: |
OLD | NEW |
---|---|
1 # Copyright: 2012 MoinMoin:CheerXiao | 1 # Copyright: 2012 MoinMoin:CheerXiao |
2 # Copyright: 2009 MoinMoin:ThomasWaldmann | 2 # Copyright: 2009 MoinMoin:ThomasWaldmann |
3 # Copyright: 2009-2011 MoinMoin:ReimarBauer | 3 # Copyright: 2009-2011 MoinMoin:ReimarBauer |
4 # Copyright: 2009 MoinMoin:ChristopherDenter | 4 # Copyright: 2009 MoinMoin:ChristopherDenter |
5 # Copyright: 2008,2009 MoinMoin:BastianBlank | 5 # Copyright: 2008,2009 MoinMoin:BastianBlank |
6 # Copyright: 2010 MoinMoin:ValentinJaniaut | 6 # Copyright: 2010 MoinMoin:ValentinJaniaut |
7 # Copyright: 2010 MoinMoin:DiogenesAugusto | 7 # Copyright: 2010 MoinMoin:DiogenesAugusto |
8 # License: GNU GPL v2 (or any later version), see LICENSE.txt for details. | 8 # License: GNU GPL v2 (or any later version), see LICENSE.txt for details. |
9 | 9 |
10 """ | 10 """ |
(...skipping 424 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
435 """ | 435 """ |
436 Dump useful data out of :self. :item contains the old item and | 436 Dump useful data out of :self. :item contains the old item and |
437 should not be the primary data source; but it can be useful in case | 437 should not be the primary data source; but it can be useful in case |
438 the data in :self is not sufficient. | 438 the data in :self is not sufficient. |
439 | 439 |
440 :returns: a tuple (meta, data, contenttype_guessed, comment), | 440 :returns: a tuple (meta, data, contenttype_guessed, comment), |
441 suitable as arguments of the same names to pass to | 441 suitable as arguments of the same names to pass to |
442 item.modify | 442 item.modify |
443 """ | 443 """ |
444 meta = self['meta_form'].value.copy() | 444 meta = self['meta_form'].value.copy() |
445 meta.update(item.meta_text_to_dict(self['extra_meta_text'].value)) | 445 if self['extra_meta_text']: # it's an optional field |
446 meta.update(item.meta_text_to_dict(self['extra_meta_text'].value )) | |
Thomas.J.Waldmann
2013/07/23 15:18:59
what happens without that check?
what values have
spy
2013/07/24 21:11:43
Without that check in case when the 'extra_meta_te
Thomas.J.Waldmann
2013/07/26 12:02:17
ok.
| |
446 data, contenttype_guessed = self['content_form']._dump(item.content) | 447 data, contenttype_guessed = self['content_form']._dump(item.content) |
447 comment = self['comment'].value | 448 comment = self['comment'].value |
448 return meta, data, contenttype_guessed, comment | 449 return meta, data, contenttype_guessed, comment |
449 | 450 |
450 def do_modify(self): | 451 def do_modify(self): |
451 """ | 452 """ |
452 Handle +modify requests, both GET and POST. | 453 Handle +modify requests, both GET and POST. |
453 | 454 |
454 This method should be overridden in subclasses, providing polymorphic | 455 This method should be overridden in subclasses, providing polymorphic |
455 behavior for the +modify view. | 456 behavior for the +modify view. |
(...skipping 365 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
821 # pointless for non-existing items | 822 # pointless for non-existing items |
822 pass | 823 pass |
823 | 824 |
824 def destroy(self, comment=u'', destroy_item=False): | 825 def destroy(self, comment=u'', destroy_item=False): |
825 # pointless for non-existing items | 826 # pointless for non-existing items |
826 pass | 827 pass |
827 | 828 |
828 | 829 |
829 from ..util.pysupport import load_package_modules | 830 from ..util.pysupport import load_package_modules |
830 load_package_modules(__name__, __path__) | 831 load_package_modules(__name__, __path__) |
OLD | NEW |