User:Eleanorg/2.2/sloganVoting
Visualizing consensus, or lack thereof, through typography.
Code
Create db
Run once, to create a Mongo db and put a few slogans in it to start.
#!/usr/bin/python
#-*- coding:utf-8 -*-
import pymongo
from pymongo import Connection
# create db and add some slogans to it.
#======== create db with slogans
#
connection = Connection()
myDB = connection['consentSlogans1']
collection = myDB.collection
slogans = [ "YES MEANS YES", "consent is sexy", "no means no"]
for x in range(0,3):
title = "slogan" + str(x)
slogan = slogans[x]
entry = {'title': title, 'slogan': slogan, 'tally': ' ' }
collection.insert(entry)
#======= test it's working
for Entry in myDB.collection.find():
print Entry