fix in related page

This commit is contained in:
Rushabh Mehta 2012-02-06 12:52:15 +05:30
parent af1cb632d6
commit 594a0ca11d
2 changed files with 24 additions and 21 deletions

View File

@ -5,45 +5,45 @@
{
'creation': '2012-02-01 16:16:47',
'docstatus': 0,
'modified': '2012-02-01 16:16:48',
'modified_by': 'Administrator',
'owner': 'Administrator'
'modified': '2012-02-06 12:24:29',
'modified_by': u'Administrator',
'owner': u'Administrator'
},
# These values are common for all DocType
{
'colour': 'White:FFF',
'colour': u'White:FFF',
'doctype': 'DocType',
'istable': 1,
'module': 'Website',
'module': u'Website',
'name': '__common__',
'section_style': 'Simple',
'section_style': u'Simple',
'show_in_menu': 0,
'version': 1
'version': 3
},
# These values are common for all DocField
{
'doctype': 'DocField',
'fieldname': 'page',
'fieldtype': 'Link',
'label': 'Page',
'doctype': u'DocField',
'fieldname': u'page',
'fieldtype': u'Link',
'label': u'Page',
'name': '__common__',
'options': 'Page',
'parent': 'Related Page',
'parentfield': 'fields',
'parenttype': 'DocType',
'options': u'Page',
'parent': u'Related Page',
'parentfield': u'fields',
'parenttype': u'DocType',
'permlevel': 0
},
# DocType, Related Page
{
'doctype': 'DocType',
'name': 'Related Page'
'name': u'Related Page'
},
# DocField
{
'doctype': 'DocField'
'doctype': u'DocField'
}
]

View File

@ -37,10 +37,13 @@ class DocType:
"title": webnotes.conn.get_value("Page", self.doc.next_page, "title")}
self.doc.see_also = ''
for l in webnotes.conn.sql("""select distinct t1.page, t2.title from
`tabRelated Page` t1, tabPage t2 where
t1.page = t2.name order by t2.title""", as_dict=1):
self.doc.see_also += """<p><a href="#!%(page)s">%(title)s</a></p>""" % l
for d in self.doclist:
if d.doctype=='Related Page':
tmp = {"page":d.page, "title":webnotes.conn.get_value('Page', d.page, 'title')}
self.doc.see_also += """<li><a href="#!%(page)s">%(title)s</a></li>""" % tmp
if self.doc.see_also:
self.doc.see_also = '<ul>%s</ul>' % self.doc.see_also
def cleanup_temp(self):
"""cleanup temp fields"""