equal
deleted
inserted
replaced
1 # copyright 2003-2010 LOGILAB S.A. (Paris, FRANCE), all rights reserved. |
1 # copyright 2003-2011 LOGILAB S.A. (Paris, FRANCE), all rights reserved. |
2 # contact http://www.logilab.fr/ -- mailto:contact@logilab.fr |
2 # contact http://www.logilab.fr/ -- mailto:contact@logilab.fr |
3 # |
3 # |
4 # This file is part of CubicWeb. |
4 # This file is part of CubicWeb. |
5 # |
5 # |
6 # CubicWeb is free software: you can redistribute it and/or modify it under the |
6 # CubicWeb is free software: you can redistribute it and/or modify it under the |
107 |
107 |
108 %(content)s |
108 %(content)s |
109 |
109 |
110 url: %(url)s |
110 url: %(url)s |
111 """ |
111 """ |
|
112 # to be defined on concrete sub-classes |
|
113 content_attr = None |
112 |
114 |
113 def context(self, **kwargs): |
115 def context(self, **kwargs): |
114 entity = self.cw_rset.get_entity(self.cw_row or 0, self.cw_col or 0) |
116 entity = self.cw_rset.get_entity(self.cw_row or 0, self.cw_col or 0) |
115 content = entity.printable_value(self.content_attr, format='text/plain') |
117 content = entity.printable_value(self.content_attr, format='text/plain') |
116 if content: |
118 if content: |