Rushabh Mehta | 12852e7 | 2012-02-29 15:11:06 +0530 | [diff] [blame] | 1 | import webnotes |
| 2 | |
| 3 | @webnotes.whitelist() |
| 4 | def 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) |