Linux Today: Linux News On Internet Time.
Search Linux Today
Linux News Sections:  Developer -  High Performance -  Infrastructure -  IT Management -  Security -  Storage -
Linux Today Navigation
LT Home
Contribute
Contribute
Link to Us
Linux Jobs

Partner Sites
JustLinux.com
Linux Planet
PHPBuilder
Technology Jobs

Top White Papers

  • Regardless of the size of your business, a Denial of Service attack can disrupt your organization's website and network services. Download this eBook for...
    Download

  • The number, complexity, and diversity of cyber threats are soaring. Businesses are increasingly concerned about the risks they face and 91% of organizations...
    Download

More on LinuxToday


Snakes on a Couch! Using Python with CouchDB, Part II-- Where do you want to eat?

Oct 14, 2010, 18:03 (0 Talkback[s])
(Other stories by Akkana Peck)

"How often do you stand around with your friends asking "Where do you want to eat?" "I dunno, where do you want to eat?" "I dunno."

"Wouldn't it be handy if you had a program to suggest a place you haven't been to in a while?

"From Part 1, you already had a view that sorts restaurant by date:

date_mapfn = """function(doc)
{
  if (doc.type == 'restaurant') {
    emit(doc.last_visited, doc.name);
  }
}"""



"In Python, retrieve the restaurants in that view like this:
import couchdb
server = couchdb.client.Server('http://localhost:5984/')
db = server['restaurants']


Complete Story

Related Stories: