You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

23 line
634 B

  1. # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
  2. # MIT License. See license.txt
  3. from __future__ import unicode_literals
  4. import frappe
  5. def get_context(context):
  6. bloggers = frappe.db.sql("""select * from `tabBlogger`
  7. where ifnull(posts,0) > 0 and ifnull(disabled,0)=0
  8. order by posts desc""", as_dict=1)
  9. writers_context = {
  10. "bloggers": bloggers,
  11. "texts": {
  12. "all_posts_by": "All posts by"
  13. },
  14. "categories": frappe.db.sql_list("select name from `tabBlog Category` order by name")
  15. }
  16. writers_context.update(frappe.get_doc("Blog Settings", "Blog Settings").fields)
  17. return writers_context