Anand Doshi | 486f9df | 2012-07-19 13:40:31 +0530 | [diff] [blame] | 1 | from __future__ import unicode_literals |
Rushabh Mehta | 12852e7 | 2012-02-29 15:11:06 +0530 | [diff] [blame] | 2 | import webnotes |
| 3 | |
| 4 | @webnotes.whitelist() |
| 5 | def get_feed(arg=None): |
| 6 | """get feed""" |
| 7 | return webnotes.conn.sql("""select |
| 8 | distinct t1.name, t1.feed_type, t1.doc_type, t1.doc_name, t1.subject, t1.owner, |
| 9 | t1.modified |
| 10 | from tabFeed t1, tabDocPerm t2 |
| 11 | where t1.doc_type = t2.parent |
| 12 | and t2.role in ('%s') |
Anand Doshi | e142d9c | 2013-01-02 16:46:35 +0530 | [diff] [blame] | 13 | and t2.permlevel = 0 |
Rushabh Mehta | 12852e7 | 2012-02-29 15:11:06 +0530 | [diff] [blame] | 14 | and ifnull(t2.`read`,0) = 1 |
| 15 | order by t1.modified desc |
| 16 | limit %s, %s""" % ("','".join(webnotes.get_roles()), |
| 17 | webnotes.form_dict['limit_start'], webnotes.form_dict['limit_page_length']), |
| 18 | as_dict=1) |