blob: 8b8faf3f5fa98c3d553ab99866fe3ecbd30ce227 [file] [log] [blame]
Rushabh Mehta12852e72012-02-29 15:11:06 +05301import webnotes
2
3@webnotes.whitelist()
4def get_feed(arg=None):
5 """get feed"""
6 return webnotes.conn.sql("""select
7 distinct t1.name, t1.feed_type, t1.doc_type, t1.doc_name, t1.subject, t1.owner,
8 t1.modified
9 from tabFeed t1, tabDocPerm t2
10 where t1.doc_type = t2.parent
11 and t2.role in ('%s')
12 and ifnull(t2.`read`,0) = 1
13 order by t1.modified desc
14 limit %s, %s""" % ("','".join(webnotes.get_roles()),
15 webnotes.form_dict['limit_start'], webnotes.form_dict['limit_page_length']),
16 as_dict=1)