[web2py] MongoDB and Web2py in Windows
Hi All, anyone have success using MongoDb in DAL? When I ran web2py, I don't see MongoDB listed. here is what I got when I ran web2py command web2py Web Framework Created by Massimo Di Pierro, Copyright 2007-2014 Version 2.9.11-stable+timestamp.2014.09.15.23.35.11 Database drivers available: SQLite(sqlite3), MySQL(pymysql), PostgreSQL(psycopg2 ), PostgreSQL(pg8000), MSSQL(pyodbc), DB2(pyodbc), Teradata(pyodbc), Ingres(pyod bc), IMAP(imaplib) I installed Pymongo. I downloaded and installed MongoDB in my Windows 7 and 8 computer to test. Same result. Thanks -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [web2py] mongodb and web2py
my advice is to pay attention to another document and graph database: orientdb http://code.google.com/p/orient/ like mongodb it is a document database, which means it can store json like objects and because it supports some sort of sql it should be much easier to write an adapter
RE: [web2py] mongodb and web2py
I have also been working on the select matter, so maybe it would be wise to cooperate? I can add you to my dropbox and we can work together? Regards Mark -Oorspronkelijk bericht- Van: web2py@googlegroups.com [mailto:web2py@googlegroups.com] Namens Paul Verzonden: zaterdag 3 december 2011 12:03 Aan: web2py-users Onderwerp: [web2py] mongodb and web2py Hi All, Since I'm interested in python, web2py and recently mongodb and after seeing breedvel...@gmail.com post http://code.google.com/p/web2py/issues/detail?id=497 to get inserts on the MongoDBAdapter working I've been hacking the MongoDBAdapter code further to get select (and,or,eq,gt,lt,le,ge,ne including orderby attribute), count, update and delete, drop and truncate working. The code is very much a hack, is only going to work for a subset of the available field types etc, as I'm still learning the dal code and had issues around the dal using 'id' as a primary key and mongodb using '_id' of type objectid, pymongo's required syntax etc.. Let me know where to post the code/changes so others can check this out, I'm not sure if Massimo still had any plans to implement this adapter? Thanks Paul - Geen virus gevonden in dit bericht. Gecontroleerd door AVG - www.avg.com Versie: 2012.0.1873 / Virusdatabase: 2102/4653 - datum van uitgifte: 12/02/11
[web2py] mongodb and web2py
Hi All, Since I'm interested in python, web2py and recently mongodb and after seeing breedvel...@gmail.com post http://code.google.com/p/web2py/issues/detail?id=497 to get inserts on the MongoDBAdapter working I've been hacking the MongoDBAdapter code further to get select (and,or,eq,gt,lt,le,ge,ne including orderby attribute), count, update and delete, drop and truncate working. The code is very much a hack, is only going to work for a subset of the available field types etc, as I'm still learning the dal code and had issues around the dal using 'id' as a primary key and mongodb using '_id' of type objectid, pymongo's required syntax etc.. Let me know where to post the code/changes so others can check this out, I'm not sure if Massimo still had any plans to implement this adapter? Thanks Paul
Re: [web2py] MongoDB and Web2py
On Sun, 2011-10-02 at 14:52 -0700, Francisco Costa wrote: > I don't want to spam the group about this, but I would like to have > some official incites about when will the DAL have a MongoDB Adapter. > > > Since this is the most requested feature by the web2py community > http://web2py.uservoice.com/forums/42577-general are there any plans > or schedule for this support? I am using pymongo directly in some experiments, but I'd prefer it to be integrated directly in the DAL. I was trying to extend the actual adapter by monkeypatching that, but I found quite hard to write that due to the lack of documentation on what adapters should do exactly (am I wrong? There's some doc that I wasn't able to find?). Anyways, I'd need MongoDBAdapter working for a project, so I'm willingly to cooperate in writing and testing that, I'm just a bit stuck trying to understand how adapters should work, by reading the source code of other adapters.. -- Samuele ~redShadow~ Santi redshadow[at]hackzine.org - redshadowhack[at]gmail.com Blog: http://hackzine.org GPG Key signature: 050D 3E9F 6E0B 44CE C008 D1FC 166C 3C7E EB26 4933 /me recommends: Squadra Informatica - http://www.squadrainformatica.com - Proud ThinkPad T-Series owner - Registered Linux-User: #440008 * GENTOO User since 1199142000 (2008-01-01) * former DEBIAN SID user "Software is like sex: it's better when it's free!" -- Linus Torvalds signature.asc Description: This is a digitally signed message part
[web2py] MongoDB and Web2py
I don't want to spam the group about this, but I would like to have some official incites about when will the DAL have a MongoDB Adapter. Since this is the most requested feature by the web2py community http://web2py.uservoice.com/forums/42577-general are there any plans or schedule for this support?
[web2py] MongoDB and Web2Py
I have read a few older messages about mongoDB being made to work with the DAL. But they all seem to be pretty dated and have not specified what was working and what wasnt. massimo menitoned that it may be ready by january of this year. But under the supported list it wasnt listed. So im just curious as to what the status of using mongoDB is with web2py and if anyone has a basic example on how I would use it. Thanks
[web2py] MongoDB and Web2Py: global variables / session problem
Hi guys, I'm trying to build a simple web app where you can upload a file into MongoDB (using GridFS) and then get the file with one-click. This is my model: Model: mongo.py --- from pymongo import Connection from gridfs import GridFS class MongoInterface: """Initialize MongoDB connection.""" def __init__(self): global fs connection = Connection('localhost', 27017) db = connection.mydb db.authenticate("myuser","mypasswd") fs = GridFS(db) def uploadFile(self,filename,data): b = fs.put(data, filename=filename) out = fs.get(b) return out def getFile(self,filename): b = fs.get_last_version(filename) return b def getList(self): out = fs.list() return out and in default controller, i wrote my methods: Controller: default.py -- ... def upload(): """global mongoId""" mongoId = MongoInterface() session.myid = mongoId """Get file name""" c = request.vars.uploadFile.filename """Get binary file""" file=request.vars.uploadFile.file """Upload file into GridFS""" file_id = mongoId.uploadFile(c,file) file_name = file_id.filename file_name = mongoId.getList() return dict(message=file_name) def getmongofile(): """global mongoId""" c = request.args mongoId = session.myid file = mongoId.getMongoFile(c) ... Now what happen? Upload files works as well as getting a list of all uploaded files but when I try to get one of the files, I got this error: file = mongoId.getMongoFile(c) AttributeError: 'NoneType' object has no attribute 'getMongoFile' I see that here I have some problems with "global" variable because it seems that it doesn't recognize mongoId descriptor. What I paste here is only the last of a long list of tests that I've done (using global doesn't work I read somewhere in the Web...). How can I maintain my connection id through different http request in order to instantiate my MongoDB just one time? Many thanks in advance for every suggestions, marcovic
[web2py] MongoDb and web2py
I want to use web2py with pymongo. I don't need ORM or or anything. I just want to connect use pymongo from Web2Py. How can I use it inside web2py. I need it for high performance use. Amit