Esempio n. 1
0
    
    p = dm.page_entry_revision_create(title, entries)
    
    p.update(dm.revision_create(user_oid))

    poid = db.revisions.insert(p)
    p["_id"] = poid

    e = dm.entry_create(poid, p['class'], p)
    eoid = db.entries.insert(e)
    
    return eoid

# now we proudly create a collection of entries and keep them around for a bit

mathjax_entries = [simple_text_entry(db, users['eric'], e['title'], e['body']) for e in text_entries.mathjax()]


# now create a page with these entries
simple_page_create(db, users['eric'], "MathJax Examples", mathjax_entries)


wikipedia_articles = [
    "Bayes'_theorem",
    "Stochastic_process",
    "Markov_chain_Monte_Carlo",
    "Particle_filter",
    "Monte_Carlo_method",
    "Nicholas_Metropolis",
    "Abelian_group",
    "Mathematical_joke",
Esempio n. 2
0
nb = dm.notebook_create("testnotebook", "notebook:testnotebook",
                        "This is a test notebook",
                        users = [v for k, v in users.iteritems()], 
                        admins = [users['eric']])
sysdb.notebooks.insert(nb)
notebookdbname = 'notebook:testnotebook'
db = mongoconn[notebookdbname]
dbutils.create_notebook_indices(db)



# now we proudly create a collection of entries and keep them around for a bit

mathjax_entries = [simple_text_entry(db, SYSDATABASE, 
                                     users['eric'], e['title'],
                                     e['body']) for e in text_entries.mathjax()]


# now create a page with these entries
simple_page_create(db, SYSDATABASE, 
                   users['eric'], "MathJax Examples", mathjax_entries)


wikipedia_articles = [
    "Bayes'_theorem",
    "Stochastic_process",
    "Markov_chain_Monte_Carlo",
    "Particle_filter",
    "Monte_Carlo_method",
    "Nicholas_Metropolis",
    "Abelian_group",